WpOrg\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.
Метод класса: Http{}
Хуков нет.
Возвращает
null. Ничего (null).
Использование
$Http = new Http(); $Http->__construct( $reason, $data );
- $reason(строка|null)
- Reason phrase.
По умолчанию:null - $data(разное)
- Associated data.
По умолчанию:null
Код Http::__construct() Http:: construct WP 7.0.1
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);
}