mirror of
https://github.com/WordPress/WordPress.git
synced 2024-11-04 18:01:42 +01:00
47c4ff7102
Reverting Requests 2.0.0 changes and moving to WordPress 6.0 cycle. Why? The namespace and file case renaming revealed 2 issues in Core's upgrader process. See https://core.trac.wordpress.org/ticket/54504#comment:22 for more information. Follow-up to [52327]. See #54562, #54504. Built from https://develop.svn.wordpress.org/trunk@52328 git-svn-id: http://core.svn.wordpress.org/trunk@51920 1a063a9b-81f0-0310-95a4-ce76da25c4cd
63 lines
1.0 KiB
PHP
63 lines
1.0 KiB
PHP
<?php
|
|
/**
|
|
* Exception for HTTP requests
|
|
*
|
|
* @package Requests
|
|
*/
|
|
|
|
/**
|
|
* Exception for HTTP requests
|
|
*
|
|
* @package Requests
|
|
*/
|
|
class Requests_Exception extends Exception {
|
|
/**
|
|
* Type of exception
|
|
*
|
|
* @var string
|
|
*/
|
|
protected $type;
|
|
|
|
/**
|
|
* Data associated with the exception
|
|
*
|
|
* @var mixed
|
|
*/
|
|
protected $data;
|
|
|
|
/**
|
|
* Create a new exception
|
|
*
|
|
* @param string $message Exception message
|
|
* @param string $type Exception type
|
|
* @param mixed $data Associated data
|
|
* @param integer $code Exception numerical code, if applicable
|
|
*/
|
|
public function __construct($message, $type, $data = null, $code = 0) {
|
|
parent::__construct($message, $code);
|
|
|
|
$this->type = $type;
|
|
$this->data = $data;
|
|
}
|
|
|
|
/**
|
|
* Like {@see getCode()}, but a string code.
|
|
*
|
|
* @codeCoverageIgnore
|
|
* @return string
|
|
*/
|
|
public function getType() {
|
|
return $this->type;
|
|
}
|
|
|
|
/**
|
|
* Gives any relevant data
|
|
*
|
|
* @codeCoverageIgnore
|
|
* @return mixed
|
|
*/
|
|
public function getData() {
|
|
return $this->data;
|
|
}
|
|
}
|