Requests_Exception::__construct() WordPress Method

The Requests_Exception::__construct() method is used to create an exception for a request. It takes two parameters: the first is the message to be displayed, and the second is the optional code number.

Requests_Exception::__construct( string $message, string $type, mixed $data = null, integer $code ) #

Create a new exception


Parameters

$message

(string)(Required)Exception message

$type

(string)(Required)Exception type

$data

(mixed)(Optional)Associated data

Default value: null

$code

(integer)(Required)Exception numerical code, if applicable


Top ↑

Source

File: wp-includes/Requests/Exception.php

	public function __construct($message, $type, $data = null, $code = 0) {
		parent::__construct($message, $code);

		$this->type = $type;
		$this->data = $data;
	}

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.