Errors – Gotta Catch 'Em All
Exceptions are clearly superior to error codes in most cases. Easier to maintain, easier to handle, and you can attach much more contextual information to them.<p>Shameless plug for my open source PHP error handler: <a href="https:&#x2F;&#x2F;github.com&#x2F;slashtrace&#x2F;slashtrace" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;slashtrace&#x2F;slashtrace</a>. I use it as a catch-all mechanism that displays detailed information about the error when running in a development environment, but sends the data to an external service (Sentry in my case) when in production.<p>Obviously there are a ton of places in the code where you want to catch and handle exceptions yourself, but having a catch-all acts as a safety net.<p>I do like their approach of logging stats for exceptions that don&#x27;t represent system errors, but which they monitor anyway (like the BadClientRequestException).