cessda / cessda.cvs.two

Apache License 2.0
0 stars 2 forks source link

Convert some requests that return HTTP 500 to return HTTP 400 codes instead #846

Closed matthew-morris-cessda closed 3 months ago

matthew-morris-cessda commented 3 months ago

HTTP 500 status codes should only be returned when a unhandled exception occurs in the server, and should not be returned for expected error cases such as invalid parameters or resources not being found.

This PR adds IllegalActionTypeException which is thrown when an ActionType is passed to a method that cannot use it. AccountResourceException has been modified to return HTTP 400 to clients.

This PR quietens the logs by pushing client errors to be logged using the debug logging level.