- if ( curl_errno( $ch ) !== 0 ) {
- $req['response']['error'] = "(curl error: " .
- curl_errno( $ch ) . ") " . curl_error( $ch );
+
+ $info = $infos[(int)$ch];
+
+ $errno = $info['result'];
+ if ( $errno !== 0 ) {
+ $req['response']['error'] = "(curl error: $errno)";
+
+ if ( version_compare( PHP_VERSION, '5.5.0' ) >= 0 ) {
+ $req['response']['error'] .= " " . curl_strerror( $errno );
+ }