CoreFiles by mySites.guru
Exception.php62 lines, 1,026 bytes, from wordpress-5.2.16.zip
Raw History Compare with 5.2.15
md5
879bac9efa180085ab33e90e1acc5249
sha1
729394ac71da07db9b78ae6d5ced30cab0b7c3e4
sha256
8dd701310f66ed7116da2558de858bcf4405abb5856050173bc3a80379e76858
<?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;
	}
}

The same content is in 481 releases, WordPress 4.6-beta1 to 5.7.21. See them all, or every version of this file.