Handler
class Handler implements ExceptionHandler (View source)
Traits
Properties
protected Container | $container | The container implementation. |
|
protected string[] | $dontReport | A list of the exception types that are not reported. |
|
protected ReportableHandler[] | $reportCallbacks | The callbacks that should be used during reporting. |
|
protected Closure[] | $renderCallbacks | The callbacks that should be used during rendering. |
|
protected Closure> | $exceptionMap | The registered exception mappings. |
|
protected string[] | $internalDontReport | A list of the internal exception types that should not be reported. |
|
protected string[] | $dontFlash | A list of the inputs that are never flashed for validation exceptions. |
Methods
Get the class name of the first parameter of the given Closure.
Get the class names of the first parameter of the given Closure, including union types.
Get the class names / types of the parameters of the given Closure.
Register the exception handling callbacks for the application.
Register a reportable callback.
Register a renderable callback.
Indicate that the given exception type should not be reported.
Get the default context variables for logging.
Convert an authentication exception into a response.
Create a response object from the given validation exception.
Convert a validation exception into a response.
Convert a validation exception into a JSON response.
Determine if the exception handler response should be JSON.
Get the Whoops handler for the application.
Render an exception to a string using Symfony.
Render the given HttpException.
Register the error template hint paths.
Get the view used to render HTTP exceptions.
Map the given exception into an Illuminate response.
Prepare a JSON response for the given exception.
Details
protected string
firstClosureParameterType(Closure $closure)
Get the class name of the first parameter of the given Closure.
protected array
firstClosureParameterTypes(Closure $closure)
Get the class names of the first parameter of the given Closure, including union types.
protected array
closureParameterTypes(Closure $closure)
Get the class names / types of the parameters of the given Closure.
void
__construct(Container $container)
Create a new exception handler instance.
void
register()
Register the exception handling callbacks for the application.
ReportableHandler
reportable(callable $reportUsing)
Register a reportable callback.
$this
renderable(callable $renderUsing)
Register a renderable callback.
protected $this
ignore(string $class)
Indicate that the given exception type should not be reported.
void
report(Throwable $e)
Report or log an exception.
bool
shouldReport(Throwable $e)
Determine if the exception should be reported.
protected bool
shouldntReport(Throwable $e)
Determine if the exception is in the "do not report" list.
protected array
exceptionContext(Throwable $e)
Get the default exception context variables for logging.
protected array
context()
Get the default context variables for logging.
protected Throwable
mapException(Throwable $e)
Map the exception using a registered mapper if possible.
protected Response
unauthenticated(Request $request, AuthenticationException $exception)
Convert an authentication exception into a response.
protected Response
convertValidationExceptionToResponse(ValidationException $e, Request $request)
Create a response object from the given validation exception.
protected Response
invalid(Request $request, ValidationException $exception)
Convert a validation exception into a response.
protected JsonResponse
invalidJson(Request $request, ValidationException $exception)
Convert a validation exception into a JSON response.
protected bool
shouldReturnJson(Request $request, Throwable $e)
Determine if the exception handler response should be JSON.
protected Response
prepareResponse(Request $request, Throwable $e)
Prepare a response for the given exception.
protected Response
convertExceptionToResponse(Throwable $e)
Create a Symfony response for the given exception.
protected string
renderExceptionContent(Throwable $e)
Get the response content for the given exception.
protected string
renderExceptionWithWhoops(Throwable $e)
Render an exception to a string using "Whoops".
protected Handler
whoopsHandler()
Get the Whoops handler for the application.
protected string
renderExceptionWithSymfony(Throwable $e, bool $debug)
Render an exception to a string using Symfony.
protected Response
renderHttpException(HttpExceptionInterface $e)
Render the given HttpException.
protected void
registerErrorViewPaths()
Register the error template hint paths.
protected string
getHttpExceptionView(HttpExceptionInterface $e)
Get the view used to render HTTP exceptions.
protected Response
toIlluminateResponse(Response $response, Throwable $e)
Map the given exception into an Illuminate response.
protected JsonResponse
prepareJsonResponse(Request $request, Throwable $e)
Prepare a JSON response for the given exception.
protected array
convertExceptionToArray(Throwable $e)
Convert the given exception to an array.
void
renderForConsole(OutputInterface $output, Throwable $e)
Render an exception to the console.
protected bool
isHttpException(Throwable $e)
Determine if the given exception is an HTTP exception.