\Whoops\HandlerJsonResponseHandler

Catches an exception and converts it to a JSON response. Additionally can also return exception frames for consumption by an API.

Summary

Methods
Properties
Constants
setRun()
setInspector()
setException()
setJsonApi()
addTraceToOutput()
handle()
contentType()
No public properties found
DONE
LAST_HANDLER
QUIT
getRun()
getInspector()
getException()
No protected properties found
N/A
No private methods found
$run
$inspector
$exception
$returnFrames
$jsonApi
N/A

Constants

DONE

DONE = 16

LAST_HANDLER

LAST_HANDLER = 32

The Handler has handled the Throwable in some way, and wishes to skip any other Handler.

Execution will continue.

QUIT

QUIT = 48

The Handler has handled the Throwable in some way, and wishes to quit/stop execution

Properties

$exception

$exception : \Throwable

Type

\Throwable

$returnFrames

$returnFrames : boolean

Type

boolean

$jsonApi

$jsonApi : boolean

Type

boolean

Methods

setException()

setException(\Throwable  $exception) : void

Parameters

\Throwable $exception

setJsonApi()

setJsonApi(boolean  $jsonApi = false) : $this

Returns errors[[]] instead of error[] to be in compliance with the json:api spec

Parameters

boolean $jsonApi

Default is false

Returns

$this

addTraceToOutput()

addTraceToOutput(boolean|null  $returnFrames = null) : boolean|$this

Parameters

boolean|null $returnFrames

Returns

boolean|$this

handle()

handle() : integer

Returns

integer

contentType()

contentType() : string

Returns

string

getException()

getException() : \Throwable

Returns

\Throwable