RestInterfaceSettings.errorHandler

Optional handler used to render custom replies in case of errors.

The handler needs to set the response status code to the provided RestErrorInformation.statusCode value and can then write a custom response body.

Note that the REST interface generator by default handles any exceptions thrown during request handling and sents a JSON response with the error message. The low level HTTPServerSettings.errorPageHandler is not invoked.

If errorHandler is not set, a JSON object with a single field "statusMessage" will be sent. In debug builds, there may also be an additional "statusDebugMessage" field that contains the full exception text, including a possible stack trace.

class RestInterfaceSettings
RestErrorHandler errorHandler;

Meta