On this page
Requests_Exception_HTTP_Unknown::__construct( string|null $reason = null, mixed $data = null )
Create a new exception
Description
If $data is an instance of Requests_Response, uses the status code from it. Otherwise, sets as 0
Parameters
$reasonstring|null Optional-
Reason phrase
Default:
null $datamixed Optional-
Associated data
Default:
null
Source
File: wp-includes/Requests/Exception/HTTP/Unknown.php. View all references
public function __construct($reason = null, $data = null) {
if ($data instanceof Requests_Response) {
$this->code = $data->status_code;
}
parent::__construct($reason, $data);
}
Related
Uses
| Uses | Description |
|---|---|
| Requests_Exception_HTTP::__construct() wp-includes/Requests/Exception/HTTP.php | Create a new exception |
© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/requests_exception_http_unknown/__construct