Backend API. Server-side code: this runs in a Codename One backend, not in the app on the device.

public interface ExceptionResolver

Turns an exception a controller threw into a response.

The build writes one for each controller with @ExceptionHandler methods and for each @ControllerAdvice bean; an application rarely implements it directly, but may, and register it as a bean like an advice.

Methods

public abstract HttpServer.Response resolve(HttpServer.Request request, HandlerMethod handler, Exception failure) throws Exception

Method details

resolve

public abstract HttpServer.Response resolve(HttpServer.Request request, HandlerMethod handler, Exception failure) throws Exception

Parameters

request HttpServer.Request
the request that failed
handler HandlerMethod
the route it matched
failure Exception
what was thrown

Returns

the response, or null when this resolver does not handle it

Throws

Exception
when handling it failed; answered as a server error