Requests_Exception

Exception for HTTP requests.

Defined (1)

The class is defined in the following location(s).

/wp-includes/Requests/Exception.php  
  1. class Requests_Exception extends Exception { 
  2. /** 
  3. * Type of exception 
  4. * @var string 
  5. */ 
  6. protected $type; 
  7.  
  8. /** 
  9. * Data associated with the exception 
  10. * @var mixed 
  11. */ 
  12. protected $data; 
  13.  
  14. /** 
  15. * Create a new exception 
  16. * @param string $message Exception message 
  17. * @param string $type Exception type 
  18. * @param mixed $data Associated data 
  19. * @param integer $code Exception numerical code, if applicable 
  20. */ 
  21. public function __construct($message, $type, $data = null, $code = 0) { 
  22. parent::__construct($message, $code); 
  23.  
  24. $this->type = $type; 
  25. $this->data = $data; 
  26.  
  27. /** 
  28. * Like {@see getCode()}, but a string code. 
  29. * @codeCoverageIgnore 
  30. * @return string 
  31. */ 
  32. public function getType() { 
  33. return $this->type; 
  34.  
  35. /** 
  36. * Gives any relevant data 
  37. * @codeCoverageIgnore 
  38. * @return mixed 
  39. */ 
  40. public function getData() { 
  41. return $this->data;