Uses
Uses | Description |
---|---|
wp-includes/Requests/Exception.php: Requests_Exception::__construct() | Create a new exception |
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.
(string|null) (Optional) Reason phrase
Default value: null
(mixed) (Optional) Associated data
Default value: null
File: wp-includes/Requests/Exception/HTTP.php
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); }
© 2003–2019 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/requests_exception_http/__construct