ProductionHandler
class ProductionHandler implements HandlerInterface
Production handler.
Traits
Handler helper trait.
Properties
protected ViewFactory | $view | View factory instance. | |
protected Request | $request | Request instance. | |
protected Response | $response | Response instance. |
Methods
bool
returnAs(string $function, array $mimes, string $partial)
Checks if we meet the requirements to return as a specific type.
from HandlerHelperTrait
int
from HandlerHelperTrait
sendResponse(Response $response, Throwable $exception)
Sends response and adds any aditional headers.
from HandlerHelperTrait
array
string
string
string
Details
in HandlerHelperTrait at line 35
protected bool
returnAs(string $function, array $mimes, string $partial)
Checks if we meet the requirements to return as a specific type.
in HandlerHelperTrait at line 62
protected bool
returnAsJson()
Should we return the error as JSON?
in HandlerHelperTrait at line 72
protected bool
returnAsXml()
Should we return the error as XML?
in HandlerHelperTrait at line 83
protected int
getStatusCode(Throwable $exception)
Returns the status code that we should send.
in HandlerHelperTrait at line 94
protected
sendResponse(Response $response, Throwable $exception)
Sends response and adds any aditional headers.
at line 58
__construct(ViewFactory $view, Request $request, Response $response)
Constructor.
at line 75
protected array
getCodeAndMessage(Throwable $exception)
Returns code and message.
at line 103
protected string
getExceptionAsJson(Throwable $exception)
Return a JSON representation of the exception.
at line 114
protected string
getExceptionAsXml(Throwable $exception)
Return a XML representation of the exception.
at line 133
protected string
getExceptionAsRenderedView(Throwable $exception)
Returns a rendered error view.
at line 163
protected string
getBody(Throwable $exception)
Returns a response body.
at line 187
mixed
handle(Throwable $exception)
Handles the exception.