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

In this article

Create a new exception

Description

If $data is an instance of \WpOrg\Requests\Response, uses the status code from it. Otherwise, sets as 0

Parameters

$reasonstring|nulloptional
Reason phrase

Default:null

$datamixedoptional
Associated data

Default:null

Source

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

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

User Contributed Notes

You must log in before being able to contribute a note or feedback.