Closed kbarber closed 3 years ago
@beanieboi this is what I was thinking in regards to those 500's we were getting. Much easier than wrapping our code in multiple parse error rescues :-). /cc @stevenharman.
@stevenharman all fixed, thanks for the comments.
When someone tries to parse bad request JSON, pliny right now will by default return a 500 via the web with an exception such as this logged:
Invalid JSON post bodies should instead return a 400, and the parse error somewhere in the body.
This PR wraps around the place we parse JSON and returns the appropriate pliny exception with a more helpful message attached to the response.