From: physikerwelt Date: Sat, 21 Nov 2015 17:05:17 +0000 (+0100) Subject: Improve error message for failing HTTP requests X-Git-Tag: 1.31.0-rc.0~8834^2 X-Git-Url: https://git.cyclocoop.org/%27.%24link.%27?a=commitdiff_plain;h=1c0004c10f85a0f2e32f4783ee7983a17a6eb00e;p=lhc%2Fweb%2Fwiklou.git Improve error message for failing HTTP requests Before this change, the information that is written to the log for requests with a non 200 return status is not very helpful. A variable $errors is created, but never used. This patch writes the $errors and the request body to the log. Change-Id: If62ec801d59b2343890f4238e5a534d034d934ad --- diff --git a/includes/HttpFunctions.php b/includes/HttpFunctions.php index 60196aba5b..e6801e3b43 100644 --- a/includes/HttpFunctions.php +++ b/includes/HttpFunctions.php @@ -80,7 +80,8 @@ class Http { } else { $errors = $status->getErrorsByType( 'error' ); $logger = LoggerFactory::getInstance( 'http' ); - $logger->warning( $status->getWikiText(), array( 'caller' => $caller ) ); + $logger->warning( $status->getWikiText(), + array( 'error' => $errors, 'caller' => $caller, 'content' => $req->getContent() ) ); return false; } }