HandleExceptions
class HandleExceptions (View source)
Properties
| static string | $reservedMemory | Reserved memory so that errors can be displayed properly on memory exhaustion. |
|
| protected Application | $app | The application instance. |
Methods
Report PHP deprecations, or convert PHP errors to ErrorException instances.
Reports a deprecation to the "deprecations" logger.
Ensure the "deprecations" logger is configured.
Ensure the "null" log driver is configured.
Handle the PHP shutdown event.
Create a new fatal error instance from an error array.
Determine if the error level is a deprecation.
Determine if the error type is fatal.
Get an instance of the exception handler.
Details
void
bootstrap(Application $app)
Bootstrap the given application.
void
handleError(int $level, string $message, string $file = '', int $line = 0, array $context = [])
Report PHP deprecations, or convert PHP errors to ErrorException instances.
void
handleDeprecation(string $message, string $file, int $line)
Reports a deprecation to the "deprecations" logger.
protected void
ensureDeprecationLoggerIsConfigured()
Ensure the "deprecations" logger is configured.
protected void
ensureNullLogDriverIsConfigured()
Ensure the "null" log driver is configured.
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.
protected void
renderForConsole(Throwable $e)
Render an exception to the console.
protected void
renderHttpResponse(Throwable $e)
Render an exception as an HTTP response and send it.
void
handleShutdown()
Handle the PHP shutdown event.
protected FatalError
fatalErrorFromPhpError(array $error, int|null $traceOffset = null)
Create a new fatal error instance from an error array.
protected bool
isDeprecation(int $level)
Determine if the error level is a deprecation.
protected bool
isFatal(int $type)
Determine if the error type is fatal.
protected void
configureCloudLogging(Application $app)
Configure the Laravel Cloud log channels.
protected ExceptionHandler
getExceptionHandler()
Get an instance of the exception handler.
Laravel Cloud is the best place to deploy Laravel, Nuxt, Express, Hono, Node.js, Bun, Go, Flask, Python, and more, with dedicated infrastructure available on AWS through Laravel Private Cloud.