* CURL Transport Exception.
* @package Requests\Exceptions
namespace WpOrg\Requests\Exception\Transport;
use WpOrg\Requests\Exception\Transport;
* CURL Transport Exception.
* @package Requests\Exceptions
final class Curl extends Transport {
const MULTI = 'cURLMulti';
const SHARE = 'cURLShare';
* Which type of cURL error
protected $type = 'Unknown';
* Clear text error message
protected $reason = 'Unknown';
* Create a new exception.
* @param string $message Exception message.
* @param string $type Exception type.
* @param mixed $data Associated data, if applicable.
* @param int $code Exception numerical code, if applicable.
public function __construct($message, $type, $data = null, $code = 0) {
$this->code = (int) $code;
$this->reason = $message;
$message = sprintf('%d %s', $this->code, $this->reason);
parent::__construct($message, $this->type, $data, $this->code);
public function getReason() {