1: <?php
2:
3: namespace mcfedr\Paypal\Exceptions;
4:
5: /**
6: * A curl problem
7: */
8: class CurlException extends Exception {
9:
10: private $url;
11: private $data;
12: private $curlMessage;
13:
14: /**
15: * @param resource $ch a cURL handle
16: * @param string $url
17: * @param string $data
18: */
19: public function __construct($ch, $url, $data) {
20: $this->url = $url;
21: $this->data = $data;
22: $this->curlMessage = curl_error($ch);
23: parent::__construct("Error posting to paypal, " . curl_error($ch), curl_errno($ch));
24: }
25:
26: public function getUrl() {
27: return $this->url;
28: }
29:
30: public function getData() {
31: return $this->data;
32: }
33:
34: public function getCurlMessage() {
35: return $this->curlMessage;
36: }
37:
38: }
39: