3 ms·
Fail fast. Return an error with a proper HTTP error code to the client, log what happened and exit the process. Every attempt at trying to recover from errors
by theshrike79 4y ago
Fail fast.
Return an error with a proper HTTP error code to the client, log what happened and exit the process.
Every attempt at trying to recover from errors will eventually fail, in most cases it's better just to fail.
- jiggawatts 4y ago> Exit the process. Nooooooo! Unless you're running PHP in cgi-bin or some anachronistic madness like that, never do any kind of process- or thread- level control for mundane issues. That makes code fantastically dangerous to reuse because rare but expected exceptions will kill everything unexpectedly, making it very hard to log and troubleshoot with tools like an APM.