Exception for unknown status responses

package Requests
inherited_from \Requests_Exception_HTTP

 Methods

Create a new exception

__construct(string|null $reason = null, mixed $data = null

If $data is an instance of \Requests_Response, uses the status code from it. Otherwise, sets as 0

inherited_from \Requests_Exception_HTTP::__construct()

Parameters

$reason

stringnull

Reason phrase

$data

mixed

Associated data

Create a new exception

__construct(string $message, string $type, mixed $data = null, integer $code = 0
Inherited

Parameters

$message

string

Exception message

$type

string

Exception type

$data

mixed

Associated data

$code

integer

Exception numerical code, if applicable

Gives any relevant data

getData() : mixed
Inherited
codeCoverageIgnore

Returns

mixed

Get the status message

getReason() 
Inherited

Like {@see getCode()}, but a string code.

getType() : string
Inherited
codeCoverageIgnore

Returns

string

Get the correct exception class for a given error code

get_class(integer|boolean $code) : string
InheritedStatic

Parameters

$code

integerboolean

HTTP status code, or false if unavailable

Returns

stringException class name to use

 Properties

 

HTTP status code

$code : integer | boolean

Default

0
inherited_from \Requests_Exception_HTTP::code
 

HTTP status code

$code : integer

Default

0
 

Data associated with the exception

$data : mixed

Default

 

Reason phrase

$reason : string

Default

'Unknown'
inherited_from \Requests_Exception_HTTP::reason
 

Reason phrase

$reason : string

Default

'Unknown'
 

Type of exception

$type : string

Default