Skip to main content

Error Handler

RestServer uses the project flip/whoops to handle the errors. The default behavior is return the error with the minimum information necessary.

"type" => Exception Type,
"message" => Error Message.

To disable completely any error handler you can:


$http = (new HttpErrorHandler())

try {
} catch (Exception $ex) {
// You have to handle by yourself the errors

or you can get the detailed error handler with all information necessary to debug your application:


$http = (new HttpErrorHandler())


The error handler return the data based on the format defined by first accept content type header.

The currently implementation are:

  • HTML
  • JSON
  • XML