W3cubDocs

/WordPress

Curl::__construct( string $message, string $type, mixed $data = null, int $code )

Create a new exception.

Parameters

$messagestringrequired
Exception message.
$typestringrequired
Exception type.
$datamixedoptional
Associated data, if applicable.

Default:null

$codeintrequired
Exception numerical code, if applicable.

Source

public function __construct($message, $type, $data = null, $code = 0) {
	if ($type !== null) {
		$this->type = $type;
	}

	if ($code !== null) {
		$this->code = (int) $code;
	}

	if ($message !== null) {
		$this->reason = $message;
	}

	$message = sprintf('%d %s', $this->code, $this->reason);
	parent::__construct($message, $this->type, $data, $this->code);
}

© 2003–2024 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/wporg-requests-exception-transport-curl/__construct