Earlier quoted context omitted.
No, you don't need to just log and return 500, you can make the software to handle these kind of errors. You could make the software call the system administrator and return a message to the user "Try again in an hour, the system administrator is fixing it now" Or if it is a timeout, the software will call amazon to buy a new machine to scale the database and send a message to the user "Try again in an hour until we…
you can make the software to handle these kind of errors. No you can not do this in all cases and I described multiple cases in my comment already in which you can't reasonably do anything automatic. Let me explain. You could make the software call the system administrator But why would I do that for every `StatementTimeoutException` at every moment of the night and why do I need to bake that into my error handling?…
Ask your boss, "do you want your users wait until the next morning for the system administrator to wake up and fix the issue? Or do you want the software inform the user how long it will take to fix the issue in seconds and start calling the system administrator to wake up and fix it?"
Because you answer based on your preferences as a worker who wants to avoid the extra work to make the system perfect and not your boss's preferences.