Fix exception on certain http failures
authorBill Pirkle <bpirkle@wikimedia.org>
Fri, 14 Dec 2018 21:55:28 +0000 (15:55 -0600)
committerBill Pirkle <bpirkle@wikimedia.org>
Fri, 14 Dec 2018 21:55:28 +0000 (15:55 -0600)
Task T202110 included a change to recognize an HTTP status code
of 0 (zero) as an error, but it failed to set a status message,
resulting in an exception.  Changed to set a status message of
'Error' so that required value is not empty.

Bug: T212005
Change-Id: I5fb78555bfcaeccdd726432f4dfc70924a385c41

includes/http/MWHttpRequest.php

index b087019..2cf5320 100644 (file)
@@ -387,7 +387,7 @@ abstract class MWHttpRequest implements LoggerAwareInterface {
 
                // Failure without (valid) headers gets a response status of zero
                if ( !$this->status->isOK() ) {
-                       $this->respStatus = '0';
+                       $this->respStatus = '0 Error';
                }
 
                foreach ( $this->headerList as $header ) {