trait InteractsWithExceptionHandling (View source)

Properties

protected ExceptionHandler|null $originalExceptionHandler

The original exception handler.

protected $except
protected $originalHandler

Methods

$this
withExceptionHandling()

Restore exception handling.

$this
handleExceptions(array $exceptions)

Only handle the given exceptions via the exception handler.

$this
handleValidationExceptions()

Only handle validation exceptions via the exception handler.

$this
withoutExceptionHandling(array $except = [])

Disable exception handling for the test.

void
__construct(ExceptionHandler $originalHandler, array $except = [])

Create a new class instance.

void
report(Exception $e)

Report or log an exception.

bool
shouldReport(Exception $e)

Determine if the exception should be reported.

Response
render(Request $request, Exception $e)

Render an exception into an HTTP response.

void
renderForConsole(OutputInterface $output, Exception $e)

Render an exception to the console.

Details

protected $this withExceptionHandling()

Restore exception handling.

Return Value

$this

protected $this handleExceptions(array $exceptions)

Only handle the given exceptions via the exception handler.

Parameters

array $exceptions

Return Value

$this

protected $this handleValidationExceptions()

Only handle validation exceptions via the exception handler.

Return Value

$this

protected $this withoutExceptionHandling(array $except = [])

Disable exception handling for the test.

Parameters

array $except

Return Value

$this

void __construct(ExceptionHandler $originalHandler, array $except = [])

Create a new class instance.

Parameters

ExceptionHandler $originalHandler
array $except

Return Value

void

void report(Exception $e)

Report or log an exception.

Parameters

Exception $e

Return Value

void

Exceptions

Exception

bool shouldReport(Exception $e)

Determine if the exception should be reported.

Parameters

Exception $e

Return Value

bool

Response render(Request $request, Exception $e)

Render an exception into an HTTP response.

Parameters

Request $request
Exception $e

Return Value

Response

Exceptions

Exception

void renderForConsole(OutputInterface $output, Exception $e)

Render an exception to the console.

Parameters

OutputInterface $output
Exception $e

Return Value

void