Certain errors occurring in the DB should be treated as critical, or more important, than the usual class that just cause exceptions. At the very least they should get logged to the error logs.
For example if the app attempts to write and causes a duplicate key error, whether on unique constraint, or on primary key constraint. This is a #1022 error and signifies a major problem in schema, or app logic, or both.
Inspired by the work on https://github.com/Discovery-Software/app.rubrix.com/issues/2576
Certain errors occurring in the DB should be treated as critical, or more important, than the usual class that just cause exceptions. At the very least they should get logged to the error logs.
For example if the app attempts to write and causes a duplicate key error, whether on unique constraint, or on primary key constraint. This is a #1022 error and signifies a major problem in schema, or app logic, or both.