The idea would be to ensure we :
- Return 400 status code for invalid JSON data
- That we use our JSON error format for:
- 500 Internal (uncatched) server errors
- 404 Not Found (calls on non routes endpoints)
Currently HTML is returned...
We need to register specific error handlers in the WebAdmin server.
- we need upon init to load the `service::internalServerError`, `service::notFound` and a `service::exception targetting JsonExtractException` in WebAdminServer :: configure.
- We should rely on the common `ErrorResponder` to have consistant error messages
- In these routes we should avoid throwing an exception. We should have an ErrorResponder::toResponse(Response response) method setting the body and the response code to be used.
If you need more details to implement this feature, we are willing to provide support. Don't hesitate to ask on https://gitter.im/apache/james-project. We are willing to provide guidance.