Skip to content
This repository has been archived by the owner on Jul 2, 2023. It is now read-only.

Improved exception handling in JSONReader and XMLReader #3

Open
budjb opened this issue Mar 31, 2016 · 1 comment
Open

Improved exception handling in JSONReader and XMLReader #3

budjb opened this issue Mar 31, 2016 · 1 comment

Comments

@budjb
Copy link
Owner

budjb commented Mar 31, 2016

From @trpedersen on August 26, 2013 6:27

Hi,

Thanks for the good work with this plugin - it is working well for us.

An improvement though - if a client programs sends through invalid JSON or XML then the JSONReader and XMLReader code falls over with an uncaught exception (e.g. JsonException) causing an HTTP 500 error back at the client. IMHO this should be instead caught and send back to the client as a BAD_REQUEST (or similar) message, rather than a server error.

The two ..readFrom methods should catch any exceptions raised during xml or json parsing and wrap them in a WebApplicationException with the appropriate Response+status+entity+type set.

I've worked around it by using ExceptionMappers for now..

Tim Pedersen

Copied from original issue: krasserm#25

@budjb
Copy link
Owner Author

budjb commented Mar 31, 2016

From @noamt on September 2, 2013 8:2

Thanks for the feedback; I'll take a look at better handling for these cases

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant