picasso icon indicating copy to clipboard operation
picasso copied to clipboard

Have proper HTTP error codes on the API

Open jan-xyz opened this issue 8 years ago • 1 comments

The API should have consistent and proper usage of HTTP error codes.

Right now wrong usage mostly results in an Internal Server Error (50x) and doesn't properly tell the user what went wrong. Furthermore, the API sometimes doesn't respond with an error code at all when obviously user input wasn't okay (see uploading files).

See https://httpstatuses.com for a list of responses.

jan-xyz avatar Jul 31 '17 21:07 jan-xyz

I would like to tackle that once the new frontend is working properly. While I'm working on that I am coming a cross multiple instances where the API doesn't handle errors properly. I will track the instances in this ticket.

So far:

  • Internal Server Error when accessing visualiser that isn't available should be a 404 instead
  • Internal Server Error when accessing image that isn't available should be a 404 instead
  • OK (200) when doing something wrong during upload should be an error (multiple cases?)

jan-xyz avatar Jul 31 '17 21:07 jan-xyz