Handler
class Handler (View source)
Properties
protected ResponsePreparerInterface | $responsePreparer | The response preparer implementation. | |
protected ExceptionDisplayerInterface | $plainDisplayer | The plain exception displayer. | |
protected ExceptionDisplayerInterface | $debugDisplayer | The debug exception displayer. | |
protected bool | $debug | Indicates if the application is in debug mode. | |
protected array | $handlers | All of the register exception handlers. | |
protected array | $handled | All of the handled error messages. |
Methods
void | __construct(ResponsePreparerInterface $responsePreparer, ExceptionDisplayerInterface $plainDisplayer, ExceptionDisplayerInterface $debugDisplayer, bool $debug = true) Create a new error handler instance. | |
void | register(string $environment) Register the exception / error handlers for the application. | |
void | registerErrorHandler() Register the PHP error handler. | |
void | registerExceptionHandler() Register the PHP exception handler. | |
void | registerShutdownHandler() Register the PHP shutdown handler. | |
handleError(int $level, string $message, string $file = '', int $line, array $context = array()) Handle a PHP error for the application. | ||
Response | handleException(Exception $exception) Handle an exception for the application. | |
void | handleUncaughtException(Exception $exception) Handle an uncaught exception. | |
void | handleShutdown() Handle the PHP shutdown event. | |
bool | isFatal(int $type) Determine if the error type is fatal. | |
void | handleConsole(Exception $exception) Handle a console exception. | |
void | callCustomHandlers(Exception $exception, bool $fromConsole = false) Handle the given exception. | |
void | displayException(Exception $exception) Display the given exception to the user. | |
bool | handlesException(Closure $handler, Exception $exception) Determine if the given handler handles this exception. | |
bool | hints(ReflectionFunction $reflection, Exception $exception) Determine if the given handler type hints the exception. | |
string | formatException(Exception $e) Format an exception thrown by a handler. | |
void | error(Closure $callback) Register an application error handler. | |
void | pushError(Closure $callback) Register an application error handler at the bottom of the stack. | |
Response | prepareResponse(mixed $response) Prepare the given response. | |
bool | runningInConsole() Determine if we are running in the console. | |
void | setDebug(bool $debug) Set the debug level for the handler. |
Details
void __construct(ResponsePreparerInterface $responsePreparer, ExceptionDisplayerInterface $plainDisplayer, ExceptionDisplayerInterface $debugDisplayer, bool $debug = true)
Create a new error handler instance.
void register(string $environment)
Register the exception / error handlers for the application.
protected void registerErrorHandler()
Register the PHP error handler.
protected void registerExceptionHandler()
Register the PHP exception handler.
protected void registerShutdownHandler()
Register the PHP shutdown handler.
handleError(int $level, string $message, string $file = '', int $line, array $context = array())
Handle a PHP error for the application.
Response handleException(Exception $exception)
Handle an exception for the application.
void handleUncaughtException(Exception $exception)
Handle an uncaught exception.
void handleShutdown()
Handle the PHP shutdown event.
protected bool isFatal(int $type)
Determine if the error type is fatal.
void handleConsole(Exception $exception)
Handle a console exception.
protected void callCustomHandlers(Exception $exception, bool $fromConsole = false)
Handle the given exception.
protected void displayException(Exception $exception)
Display the given exception to the user.
protected bool handlesException(Closure $handler, Exception $exception)
Determine if the given handler handles this exception.
protected bool hints(ReflectionFunction $reflection, Exception $exception)
Determine if the given handler type hints the exception.
protected string formatException(Exception $e)
Format an exception thrown by a handler.
void error(Closure $callback)
Register an application error handler.
void pushError(Closure $callback)
Register an application error handler at the bottom of the stack.
protected Response prepareResponse(mixed $response)
Prepare the given response.
bool runningInConsole()
Determine if we are running in the console.
void setDebug(bool $debug)
Set the debug level for the handler.
© Taylor Otwell
Licensed under the MIT License.
Laravel is a trademark of Taylor Otwell.
https://laravel.com/api/4.2/Illuminate/Exception/Handler.html