There seems to have been a decision to change all MySQL errors to validation errors with the error message Validation Failed and a 4xx status code. Sometimes, the errors are 5xx errors, like malformed SQL queries, but we lose this information when we change the status code and message. This seems to have been deliberately added in in this PR. We also expose DB implementation details in our API response messages when these errors occur, such as in this issue here
Changes
I think we should revisit how we handle DB error handling and not change the error status code or message for when actual 5xx DB errors occur. We should also ensure we don't leak DB implementation details in the error responses.
QA
Risk assessment
Risk level: Low
Testing notes
Confirmation
[ ] Engineer (@____): Added comment to user story confirming successful completion of QA.
[ ] QA (@____): Added comment to user story confirming successful completion of QA.
Goal
Context
There seems to have been a decision to change all MySQL errors to validation errors with the error message
Validation Failed
and a4xx
status code. Sometimes, the errors are 5xx errors, like malformed SQL queries, but we lose this information when we change the status code and message. This seems to have been deliberately added in in this PR. We also expose DB implementation details in our API response messages when these errors occur, such as in this issue hereChanges
I think we should revisit how we handle DB error handling and not change the error status code or message for when actual 5xx DB errors occur. We should also ensure we don't leak DB implementation details in the error responses.
QA
Risk assessment
Testing notes
Confirmation