Gergő Tisza has uploaded a new change for review.
https://gerrit.wikimedia.org/r/248586
Change subject: Improve error message for non-success HTTP response
......................................................................
Improve error message for non-success HTTP response
Bug: T116349
Change-Id: I3fd219781b0e80dc2a8b870b847f9a2c30f42269
---
M src/Client.php
1 file changed, 5 insertions(+), 1 deletion(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/oauthclient-php
refs/changes/86/248586/1
diff --git a/src/Client.php b/src/Client.php
index f8423d7..27f4e57 100644
--- a/src/Client.php
+++ b/src/Client.php
@@ -263,7 +263,11 @@
}
$data = curl_exec( $ch );
if ( !$data ) {
- throw new Exception( 'Curl error: ' . curl_error( $ch )
);
+ if ( curl_errno( $ch ) ) {
+ throw new Exception( 'Curl error: ' .
curl_error( $ch ) );
+ } else {
+ throw new Exception( 'Empty HTTP response!
Status: ' . curl_getinfo( $ch, CURLINFO_HTTP_CODE ) );
+ }
}
return $data;
}
--
To view, visit https://gerrit.wikimedia.org/r/248586
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I3fd219781b0e80dc2a8b870b847f9a2c30f42269
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/oauthclient-php
Gerrit-Branch: master
Gerrit-Owner: Gergő Tisza <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits