ErrorHandler
class ErrorHandler
Error handler.
Properties
protected Container | $container | Container. | |
protected bool | $disableShutdownHandler | Is the shutdown handler disabled? | |
protected array | $handlers | Exception handlers. | |
protected LoggerInterface | $logger | Logger instance. | |
protected array | $dontLog | Exception types that shouldn't be logged. |
Methods
Adds basic fallback handler to the stack.
Registers the exception handler.
Return logger instance.
Disables logging for an exception type.
Disables the shutdown handler.
Clears all error handlers for an exception type.
Replaces all error handlers for an exception type with a new one.
Clear output buffers.
Creates and returns an error handler instance.
Details
at line 75
__construct(Container|null $container = null)
Constructor.
at line 91
protected
fallbackHandler()
Adds basic fallback handler to the stack.
at line 106
protected
register()
Registers the exception handler.
at line 132
setLogger(Closure|LoggerInterface $logger)
Set logger instance or closure that returns a logger instance.
at line 142
LoggerInterface
getLogger()
Return logger instance.
at line 157
dontLog(string|array $exceptionType)
Disables logging for an exception type.
at line 168
disableLoggingFor(string|array $exceptionType)
deprecated
deprecated
Disables logging for an exception type.
at line 176
disableShutdownHandler()
Disables the shutdown handler.
at line 187
handle(string $exceptionType, string|Closure $handler)
Prepends an exception handler to the stack.
at line 197
clearHandlers(string $exceptionType)
Clears all error handlers for an exception type.
at line 214
replaceHandlers(string $exceptionType, Closure $handler)
Replaces all error handlers for an exception type with a new one.
at line 224
protected
clearOutputBuffers()
Clear output buffers.
at line 235
protected bool
shouldExceptionBeLogged(Throwable $exception)
Should the exception be logged?
at line 259
protected HandlerInterface
handlerFactory(string $handler)
Creates and returns an error handler instance.
at line 271
protected mixed
handleException(string|Closure $handler, Throwable $exception)
Handle the exception.
at line 286
handler(Throwable $exception)
Handles uncaught exceptions.