October\Rain\Foundation\Exception\Handler
Overview
Handler is the core exception handler
Extends
- Illuminate\Foundation\Exceptions\Handler
Implements
- Illuminate\Contracts\Debug\ExceptionHandler
Protected Properties
protected array $dontReport
dontReport these exception types.
protected array $handlers
handlers for registered exceptions.
Show inherited protected properties
Inherited Protected Properties
- $container - The container implementation. (defined in Illuminate\Foundation\Exceptions\Handler)
- $dontReportCallbacks - The callbacks that inspect exceptions to determine if they should be reported. (defined in Illuminate\Foundation\Exceptions\Handler)
- $dontRetry - A list of the exception types that should stop job retries. (defined in Illuminate\Foundation\Exceptions\Handler)
- $dontRetryCallbacks - The callbacks that inspect exceptions to determine if they should stop job retries. (defined in Illuminate\Foundation\Exceptions\Handler)
- $reportCallbacks - The callbacks that should be used during reporting. (defined in Illuminate\Foundation\Exceptions\Handler)
- $levels - A map of exceptions with their corresponding custom log levels. (defined in Illuminate\Foundation\Exceptions\Handler)
- $throttleCallbacks - The callbacks that should be used to throttle reportable exceptions. (defined in Illuminate\Foundation\Exceptions\Handler)
- $contextCallbacks - The callbacks that should be used to build exception context data. (defined in Illuminate\Foundation\Exceptions\Handler)
- $currentlyReporting - The exception currently being reported. (defined in Illuminate\Foundation\Exceptions\Handler)
- $renderCallbacks - The callbacks that should be used during rendering. (defined in Illuminate\Foundation\Exceptions\Handler)
- $shouldRenderJsonWhenCallback - The callback that determines if the exception handler response should be JSON. (defined in Illuminate\Foundation\Exceptions\Handler)
- $finalizeResponseCallback - The callback that prepares responses to be returned to the browser. (defined in Illuminate\Foundation\Exceptions\Handler)
- $exceptionMap - The registered exception mappings. (defined in Illuminate\Foundation\Exceptions\Handler)
- $hashThrottleKeys - Indicates that throttled keys should be hashed. (defined in Illuminate\Foundation\Exceptions\Handler)
- $internalDontReport - A list of the internal exception types that should not be reported. (defined in Illuminate\Foundation\Exceptions\Handler)
- $dontFlash - A list of the inputs that are never flashed for validation exceptions. (defined in Illuminate\Foundation\Exceptions\Handler)
- $withoutDuplicates - Indicates that an exception instance should only be reported once. (defined in Illuminate\Foundation\Exceptions\Handler)
- $reportedExceptionMap - The already reported exception map. (defined in Illuminate\Foundation\Exceptions\Handler)
Public Methods
public error()
public error($callback): void
public render()
public render(
Illuminate\Http\Request $request,
Throwable $exception
): Symfony\Component\HttpFoundation\Response
render an exception into an HTTP response.
public report()
public report(Throwable $exception): void
report or log an exception.
This is a great spot to send exceptions to Sentry, Bugsnag, etc.
Inherited Public Methods
- __construct() - Create a new exception handler instance. (defined in Illuminate\Foundation\Exceptions\Handler)
- buildContextForException() - Creates the context for an exception. (defined in Illuminate\Foundation\Exceptions\Handler)
- buildContextUsing() - Register a closure that should be used to build exception context data. (defined in Illuminate\Foundation\Exceptions\Handler)
- contextForException() - Create the context array for logging the given exception. (defined in Illuminate\Foundation\Exceptions\Handler)
- dontFlash() - Indicate that the given attributes should never be flashed to the session on validation errors. (defined in Illuminate\Foundation\Exceptions\Handler)
- dontReport() - Indicate that the given exception type should not be reported. (defined in Illuminate\Foundation\Exceptions\Handler)
- dontReportDuplicates() - Do not report duplicate exceptions. (defined in Illuminate\Foundation\Exceptions\Handler)
- dontReportWhen() - Register a callback to determine if an exception should not be reported. (defined in Illuminate\Foundation\Exceptions\Handler)
- dontRetry() - Indicate that the given exception type should stop job retries. (defined in Illuminate\Foundation\Exceptions\Handler)
- dontRetryWhen() - Register a callback to determine if an exception should stop job retries. (defined in Illuminate\Foundation\Exceptions\Handler)
- ignore() - Indicate that the given exception type should not be reported. (defined in Illuminate\Foundation\Exceptions\Handler)
- isReporting() - Determine if a given exception is being reported. (defined in Illuminate\Foundation\Exceptions\Handler)
- level() - Set the log level for the given exception type. (defined in Illuminate\Foundation\Exceptions\Handler)
- map() - Register a new exception mapping. (defined in Illuminate\Foundation\Exceptions\Handler)
- register() - Register the exception handling callbacks for the application. (defined in Illuminate\Foundation\Exceptions\Handler)
- renderForConsole() - Render an exception to the console. (defined in Illuminate\Foundation\Exceptions\Handler)
- renderable() - Register a renderable callback. (defined in Illuminate\Foundation\Exceptions\Handler)
- reportable() - Register a reportable callback. (defined in Illuminate\Foundation\Exceptions\Handler)
- respondUsing() - Prepare the final, rendered response for an exception using the given callback. (defined in Illuminate\Foundation\Exceptions\Handler)
- shouldRenderJsonWhen() - Register the callable that determines if the exception handler response should be JSON. (defined in Illuminate\Foundation\Exceptions\Handler)
- shouldReport() - Determine if the exception should be reported. (defined in Illuminate\Foundation\Exceptions\Handler)
- shouldStopRetries() - Determine if the exception should stop job retries. (defined in Illuminate\Foundation\Exceptions\Handler)
- stopIgnoring() - Remove the given exception class from the list of exceptions that should be ignored. (defined in Illuminate\Foundation\Exceptions\Handler)
- throttleUsing() - Specify the callback that should be used to throttle reportable exceptions. (defined in Illuminate\Foundation\Exceptions\Handler)
Protected Methods
protected context()
protected context(): array
context is the the default context variables for logging.
protected getStatusCode()
protected getStatusCode(Exception $exception): int
getStatusCode checks if the exception implements the HttpExceptionInterface, or returns as generic 500 error code for a server side error.
protected hasBootedEvents()
protected hasBootedEvents(): bool
hasBootedEvents checks if we can broadcast events
protected prepareException()
protected prepareException(Throwable $e): Throwable
prepareException for rendering.
Show inherited protected methods
Inherited Protected Methods
- buildExceptionContext() - Create the context array for logging the given exception. (defined in Illuminate\Foundation\Exceptions\Handler)
- closureParameterTypes() - Get the class names / types of the parameters of the given Closure. (defined in Illuminate\Foundation\Exceptions\Handler)
- closureReturnTypes() - Get the class names / types of the return type of the given Closure. (defined in Illuminate\Foundation\Exceptions\Handler)
- convertExceptionToArray() - Convert the given exception to an array. (defined in Illuminate\Foundation\Exceptions\Handler)
- convertExceptionToResponse() - Create a Symfony response for the given exception. (defined in Illuminate\Foundation\Exceptions\Handler)
- convertValidationExceptionToResponse() - Create a response object from the given validation exception. (defined in Illuminate\Foundation\Exceptions\Handler)
- exceptionContext() - Get the default exception context variables for logging. (defined in Illuminate\Foundation\Exceptions\Handler)
- finalizeRenderedResponse() - Prepare the final, rendered response to be returned to the browser. (defined in Illuminate\Foundation\Exceptions\Handler)
- firstClosureParameterType() - Get the class name of the first parameter of the given Closure. (defined in Illuminate\Foundation\Exceptions\Handler)
- firstClosureParameterTypes() - Get the class names of the first parameter of the given Closure, including union types. (defined in Illuminate\Foundation\Exceptions\Handler)
- getHttpExceptionView() - Get the view used to render HTTP exceptions. (defined in Illuminate\Foundation\Exceptions\Handler)
- invalid() - Convert a validation exception into a response. (defined in Illuminate\Foundation\Exceptions\Handler)
- invalidJson() - Convert a validation exception into a JSON response. (defined in Illuminate\Foundation\Exceptions\Handler)
- isHttpException() - Determine if the given exception is an HTTP exception. (defined in Illuminate\Foundation\Exceptions\Handler)
- mapException() - Map the exception using a registered mapper if possible. (defined in Illuminate\Foundation\Exceptions\Handler)
- mapLogLevel() - Map the exception to a log level. (defined in Illuminate\Foundation\Exceptions\Handler)
- newLogger() - Create a new logger instance. (defined in Illuminate\Foundation\Exceptions\Handler)
- prepareJsonResponse() - Prepare a JSON response for the given exception. (defined in Illuminate\Foundation\Exceptions\Handler)
- prepareResponse() - Prepare a response for the given exception. (defined in Illuminate\Foundation\Exceptions\Handler)
- registerErrorViewPaths() - Register the error template hint paths. (defined in Illuminate\Foundation\Exceptions\Handler)
- renderExceptionContent() - Get the response content for the given exception. (defined in Illuminate\Foundation\Exceptions\Handler)
- renderExceptionResponse() - Render a default exception response if any. (defined in Illuminate\Foundation\Exceptions\Handler)
- renderExceptionWithCustomRenderer() - Render an exception to a string using the registered
ExceptionRenderer. (defined in Illuminate\Foundation\Exceptions\Handler) - renderExceptionWithSymfony() - Render an exception to a string using Symfony. (defined in Illuminate\Foundation\Exceptions\Handler)
- renderHttpException() - Render the given HttpException. (defined in Illuminate\Foundation\Exceptions\Handler)
- renderViaCallbacks() - Try to render a response from request and exception via render callbacks. (defined in Illuminate\Foundation\Exceptions\Handler)
- reportThrowable() - Reports error based on report method on exception or to logger. (defined in Illuminate\Foundation\Exceptions\Handler)
- shouldReturnJson() - Determine if the exception handler response should be JSON. (defined in Illuminate\Foundation\Exceptions\Handler)
- shouldntReport() - Determine if the exception is in the "do not report" list. (defined in Illuminate\Foundation\Exceptions\Handler)
- throttle() - Throttle the given exception. (defined in Illuminate\Foundation\Exceptions\Handler)
- toIlluminateResponse() - Map the given exception into an Illuminate response. (defined in Illuminate\Foundation\Exceptions\Handler)
- unauthenticated() - Convert an authentication exception into a response. (defined in Illuminate\Foundation\Exceptions\Handler)