ErrorHandler

ErrorHandler

class ErrorHandler

A generic ErrorHandler for the PHP engine.

Provides five bit fields that control how errors are handled: - thrownErrors: errors thrown as \ErrorException - loggedErrors: logged errors, when not @-silenced - scopedErrors: errors thrown or logged with their local context - tracedErrors: errors logged with their stack trace - screamedErrors: never @-silenced errors

Each error level can be logged by a dedicated PSR-3 logger object. Screaming only applies to logging. Throwing takes precedence over logging. Uncaught exceptions are logged as EERROR. EDEPRECATED and EUSERDEPRECATED levels never throw. ERECOVERABLEERROR and EUSERERROR levels always throw. Non catchable errors that can be detected at shutdown time are logged when the scream bit field allows so. As errors have a performance cost, repeated errors are all logged, so that