Requests_Exception_HTTP::__construct()
Create a new exception
There is no mechanism to pass in the status code, as this is set by the subclass used. Reason phrases can vary, however.
{} It's a method of the class: Requests_Exception_HTTP{}
No Hooks.
Return
null
. Nothing.
Usage
$Requests_Exception_HTTP = new Requests_Exception_HTTP(); $Requests_Exception_HTTP->__construct( $reason, $data );
- $reason(string|null)
- Reason phrase
Default: null - $data(mixed)
- Associated data
Default: null
Code of Requests_Exception_HTTP::__construct() Requests Exception HTTP:: construct WP 6.0
public function __construct($reason = null, $data = null) { if ($reason !== null) { $this->reason = $reason; } $message = sprintf('%d %s', $this->code, $this->reason); parent::__construct($message, 'httpresponse', $data, $this->code); }