Requests_Exception_HTTP_Unknown::__construct

Advertisement

Summery Summery

Create a new exception

Syntax Syntax

Requests_Exception_HTTP_Unknown::__construct( string|null $reason = null, mixed $data = null )

Description Description

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

Parameters Parameters

$reason

(Optional) Reason phrase

Default value: null

$data

(Optional) Associated data

Default value: null

Source Source

File: wp-includes/Requests/Exception/HTTP/Unknown.php

	public function __construct($reason = null, $data = null) {
		if ($data instanceof Requests_Response) {
			$this->code = $data->status_code;
		}

		parent::__construct($reason, $data);
	}

Advertisement

Advertisement

Leave a Reply