class HandleExceptions (View source)

Properties

static string|null $reservedMemory

Reserved memory so that errors can be displayed properly on memory exhaustion.

static protected Application $app

The application instance.

Methods

void
bootstrap(Application $app)

Bootstrap the given application.

void
handleError(int $level, string $message, string $file = '', int $line = 0)

Report PHP deprecations, or convert PHP errors to ErrorException instances.

void
handleDeprecationError(string $message, string $file, int $line, int $level = E_DEPRECATED)

Reports a deprecation to the "deprecations" logger.

bool
shouldIgnoreDeprecationErrors()

Determine if deprecation errors should be ignored.

void
ensureDeprecationLoggerIsConfigured(Repository $config)

Ensure the "deprecations" logger is configured.

void
ensureNullLogDriverIsConfigured(Repository $config)

Ensure the "null" log driver is configured.

void
handleException(Throwable $e)

Handle an uncaught exception from the application.

void
renderForConsole(Throwable $e)

Render an exception to the console.

void
renderHttpResponse(Throwable $e)

Render an exception as an HTTP response and send it.

void
handleShutdown()

Handle the PHP shutdown event.

FatalError
fatalErrorFromPhpError(array $error, int|null $traceOffset = null)

Create a new fatal error instance from an error array.

callable
forwardsTo($method)

Forward a method call to the given method if an application instance exists.

bool
isDeprecation(int $level)

Determine if the error level is a deprecation.

bool
isFatal(int $type)

Determine if the error type is fatal.

getExceptionHandler()

Get an instance of the exception handler.

static void
forgetApp() deprecated

Clear the local application instance from memory.

static void
flushState(TestCase|null $testCase = null)

Flush the bootstrapper's global state.

static void
flushHandlersState(TestCase|null $testCase = null)

Flush the bootstrapper's global handlers state.

Details

void bootstrap(Application $app)

Bootstrap the given application.

Parameters

Application $app

Return Value

void

void handleError(int $level, string $message, string $file = '', int $line = 0)

Report PHP deprecations, or convert PHP errors to ErrorException instances.

Parameters

int $level
string $message
string $file
int $line

Return Value

void

Exceptions

ErrorException

void handleDeprecationError(string $message, string $file, int $line, int $level = E_DEPRECATED)

Reports a deprecation to the "deprecations" logger.

Parameters

string $message
string $file
int $line
int $level

Return Value

void

protected bool shouldIgnoreDeprecationErrors()

Determine if deprecation errors should be ignored.

Return Value

bool

protected void ensureDeprecationLoggerIsConfigured(Repository $config)

Ensure the "deprecations" logger is configured.

Parameters

Repository $config

Return Value

void

protected void ensureNullLogDriverIsConfigured(Repository $config)

Ensure the "null" log driver is configured.

Parameters

Repository $config

Return Value

void

void handleException(Throwable $e)

Handle an uncaught exception from the application.

Note: Most exceptions can be handled via the try / catch block in the HTTP and Console kernels. But, fatal error exceptions must be handled differently since they are not normal exceptions.

Parameters

Throwable $e

Return Value

void

protected void renderForConsole(Throwable $e)

Render an exception to the console.

Parameters

Throwable $e

Return Value

void

protected void renderHttpResponse(Throwable $e)

Render an exception as an HTTP response and send it.

Parameters

Throwable $e

Return Value

void

void handleShutdown()

Handle the PHP shutdown event.

Return Value

void

protected FatalError fatalErrorFromPhpError(array $error, int|null $traceOffset = null)

Create a new fatal error instance from an error array.

Parameters

array $error
int|null $traceOffset

Return Value

FatalError

protected callable forwardsTo($method)

Forward a method call to the given method if an application instance exists.

Parameters

$method

Return Value

callable

protected bool isDeprecation(int $level)

Determine if the error level is a deprecation.

Parameters

int $level

Return Value

bool

protected bool isFatal(int $type)

Determine if the error type is fatal.

Parameters

int $type

Return Value

bool

protected ExceptionHandler getExceptionHandler()

Get an instance of the exception handler.

Return Value

ExceptionHandler

static void forgetApp() deprecated

deprecated This method will be removed in a future Laravel version.

Clear the local application instance from memory.

Return Value

void

static void flushState(TestCase|null $testCase = null)

Flush the bootstrapper's global state.

Parameters

TestCase|null $testCase

Return Value

void

static void flushHandlersState(TestCase|null $testCase = null)

Flush the bootstrapper's global handlers state.

Parameters

TestCase|null $testCase

Return Value

void