File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -194,6 +194,14 @@ public function curlErrorCode()
194194 {
195195 return $ this ->provider ->curlErrorNumber ;
196196 }
197+ /**
198+ * The error message of curl, text representation of code.
199+ * @return int The error number of curl.
200+ */
201+ public function curlErrorMessage ()
202+ {
203+ return $ this ->provider ->curlError ;
204+ }
197205
198206 /**
199207 * The HTTP status code of the latest response from the REST API.
Original file line number Diff line number Diff line change @@ -83,7 +83,7 @@ class CommunicationProvider
8383 * @var
8484 * @ignore
8585 */
86- protected $ curlError ;
86+ public $ curlError ;
8787 /**
8888 * @var
8989 * @ignore
@@ -747,7 +747,7 @@ public function storeToProperties()
747747 $ this ->totalCount = null ;
748748 $ this ->foundCount = null ;
749749 $ this ->returnedCount = null ;
750-
750+ $ this -> errorMessage = null ;
751751
752752 if (property_exists ($ this , 'responseBody ' )) {
753753 $ rbody = $ this ->responseBody ;
@@ -756,6 +756,7 @@ public function storeToProperties()
756756 $ result = $ rbody ->messages [0 ];
757757 $ this ->httpStatus = $ this ->getCurlInfo ("http_code " );
758758 $ this ->errorCode = property_exists ($ result , 'code ' ) ? $ result ->code : -1 ;
759+ $ this ->errorMessage = property_exists ($ result , 'message ' ) && $ result ->code != 0 ? $ result ->message : null ;
759760 }
760761 if (property_exists ($ rbody , 'response ' )) {
761762 $ result = $ rbody ->response ;
You can’t perform that action at this time.
0 commit comments