Requests_Exception_HTTP_Unknown

Exception for unknown status responses.

Defined (1)

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

/wp-includes/Requests/Exception/HTTP/Unknown.php  
  1. class Requests_Exception_HTTP_Unknown extends Requests_Exception_HTTP { 
  2. /** 
  3. * HTTP status code 
  4. * @var integer|bool Code if available, false if an error occurred 
  5. */ 
  6. protected $code = 0; 
  7.  
  8. /** 
  9. * Reason phrase 
  10. * @var string 
  11. */ 
  12. protected $reason = 'Unknown'; 
  13.  
  14. /** 
  15. * Create a new exception 
  16. * If `$data` is an instance of {@see Requests_Response}, uses the status 
  17. * code from it. Otherwise, sets as 0 
  18. * @param string|null $reason Reason phrase 
  19. * @param mixed $data Associated data 
  20. */ 
  21. public function __construct($reason = null, $data = null) { 
  22. if ($data instanceof Requests_Response) { 
  23. $this->code = $data->status_code; 
  24.  
  25. parent::__construct($reason, $data);