From 1c0004c10f85a0f2e32f4783ee7983a17a6eb00e Mon Sep 17 00:00:00 2001 From: physikerwelt Date: Sat, 21 Nov 2015 18:05:17 +0100 Subject: [PATCH] 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 --- includes/HttpFunctions.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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; } } -- 2.20.1