Closed batpad closed 6 years ago
We should encapsulate this ticket into a general pattern to do better error handling.
These are docs for the error classes that Sequelize raises: https://sequelize.readthedocs.io/en/latest/api/sequelize/#error
I imagine we'd want to check in our catch
code if the error raised is an instanceOf
expected error classes in that list and then raise an appropriate error with appropriate status code, and if not, let it fallback to a 500 which should ideally then raise some sort of alarm so we can see what went wrong / how we got an unexpected error.
We should give a better error message if the user tries to POST an item to a project with the same id as already exists - server currently returns a 500.
cc @emilymdubois