class SS_HTTPResponse_Exception extends Exception

A {@link SS_HTTPResponse} encapsulated in an exception, which can interrupt the processing flow and be caught by the {@link RequestHandler} and returned to the user.

Example Usage: throw new SS_HTTPResponse_Exception('This request was invalid.', 400); throw new SS_HTTPResponse_Exception(new SS_HTTPResponse('There was an internal server error.', 500));

Methods

__construct(string|SS_HTTPResponse $body = null, int $statusCode = null, string $statusDescription = null)

No description

getResponse()

No description

setResponse(SS_HTTPResponse $response)

No description

Details

at line 332
__construct(string|SS_HTTPResponse $body = null, int $statusCode = null, string $statusDescription = null)

Parameters

string|SS_HTTPResponse $body body Either the plaintext content of the error message, or an SS_HTTPResponse object representing it. In either case, the $statusCode and $statusDescription will be the HTTP status of the resulting response.
int $statusCode
string $statusDescription

See also

SS_HTTPResponse::__construct();

at line 354
SS_HTTPResponse getResponse()

Return Value

SS_HTTPResponse

at line 361
setResponse(SS_HTTPResponse $response)

Parameters

SS_HTTPResponse $response