[ 
https://issues.apache.org/jira/browse/JAMES-2314?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Tellier Benoit updated JAMES-2314:
----------------------------------
    Description: 
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.



  was:
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...


> Better handle exceptions in webAdmin
> ------------------------------------
>
>                 Key: JAMES-2314
>                 URL: https://issues.apache.org/jira/browse/JAMES-2314
>             Project: James Server
>          Issue Type: Improvement
>          Components: webadmin
>            Reporter: Tellier Benoit
>            Priority: Major
>              Labels: easyfix, newbie
>
> 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.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to