File tree Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -29,6 +29,11 @@ public function executeCurl();
2929 */
3030 public function getInfo ($ name );
3131
32+ /**
33+ * @return string
34+ */
35+ public function getError ();
36+
3237 /**
3338 * @return mixed
3439 */
Original file line number Diff line number Diff line change @@ -186,7 +186,7 @@ public function execute()
186186 {
187187 $ this ->response = $ this ->executeCurl ();
188188 if (!$ this ->response ) {
189- throw new MailchimpException ("The curl request failed " );
189+ throw new MailchimpException ("The curl request failed: " . $ this -> getError () );
190190 }
191191
192192 $ this ->http_code = $ this ->getInfo (CURLINFO_HTTP_CODE );
@@ -267,6 +267,14 @@ public function getInfo($name)
267267 return curl_getinfo ($ this ->handle , $ name );
268268 }
269269
270+ /**
271+ * @return string
272+ */
273+ public function getError ()
274+ {
275+ return curl_error ($ this ->handle );
276+ }
277+
270278 /**
271279 * @inheritdoc
272280 */
You can’t perform that action at this time.
0 commit comments