\Cake\Http\ExceptionServiceUnavailableException

Represents an HTTP 503 error.

All HTTP status/error related exceptions should extend this class so catch blocks can be specifically typed.

You may also use this as a meaningful bridge to Cake\Core\Exception\Exception, e.g.: throw new \Cake\Network\Exception\HttpException('HTTP Version Not Supported', 505);

Summary

Methods
Properties
Constants
__construct()
getAttributes()
responseHeader()
No public properties found
No constants found
No protected methods found
$_attributes
$_messageTemplate
$_responseHeaders
$_defaultCode
N/A
No private methods found
No private properties found
N/A

Properties

$_attributes

$_attributes : array

Array of attributes that are passed in from the constructor, and made available in the view when a development error is displayed.

Type

array

$_messageTemplate

$_messageTemplate : string

Template string that has attributes sprintf()'ed into it.

Type

string

$_responseHeaders

$_responseHeaders : array|null

Array of headers to be passed to Cake\Http\Response::header()

Type

array|null

$_defaultCode

$_defaultCode : 

{@inheritDoc}

Type

Methods

__construct()

__construct(string|null  $message = null, integer  $code = null, \Exception|null  $previous = null) 

Constructor

Parameters

string|null $message

If no message is given 'Service Unavailable' will be the message

integer $code

Status code, defaults to 503

\Exception|null $previous

The previous exception.

getAttributes()

getAttributes() : array

Get the passed in attributes

Returns

array

responseHeader()

responseHeader(string|array|null  $header = null, string|null  $value = null) : array

Get/set the response header to be used

See also Cake\Http\Response::withHeader()

Parameters

string|array|null $header

An array of header strings or a single header string

  • an associative array of "header name" => "header value"
  • an array of string headers is also accepted (deprecated)
string|null $value

The header value.

Returns

array