Requests_Exception_Transport_cURL

The WordPress Core Requests Exception Transport cURL class.

Defined (1)

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

/wp-includes/Requests/Exception/Transport/cURL.php  
  1. class Requests_Exception_Transport_cURL extends Requests_Exception_Transport { 
  2.  
  3. const EASY = 'cURLEasy'; 
  4. const MULTI = 'cURLMulti'; 
  5. const SHARE = 'cURLShare'; 
  6.  
  7. /** 
  8. * cURL error code 
  9. * @var integer 
  10. */ 
  11. protected $code = -1; 
  12.  
  13. /** 
  14. * Which type of cURL error 
  15. * EASY|MULTI|SHARE 
  16. * @var string 
  17. */ 
  18. protected $type = 'Unknown'; 
  19.  
  20. /** 
  21. * Clear text error message 
  22. * @var string 
  23. */ 
  24. protected $reason = 'Unknown'; 
  25.  
  26. public function __construct($message, $type, $data = null, $code = 0) { 
  27. if ($type !== null) { 
  28. $this->type = $type; 
  29.  
  30. if ($code !== null) { 
  31. $this->code = $code; 
  32.  
  33. if ($message !== null) { 
  34. $this->reason = $message; 
  35.  
  36. $message = sprintf('%d %s', $this->code, $this->reason); 
  37. parent::__construct($message, $this->type, $data, $this->code); 
  38.  
  39. /** 
  40. * Get the error message 
  41. */ 
  42. public function getReason() { 
  43. return $this->reason; 
  44.