Follow-up f5e9d4e: log parsing failures and API errors too

Change-Id: Ie00994008aab632a9b02d11b840457e91546b12a
This commit is contained in:
Roan Kattouw 2016-05-13 15:52:33 -07:00
parent 712109fa5d
commit c7bdb879e6

View file

@ -387,11 +387,13 @@ class ApiEchoNotifications extends ApiQueryBase {
if ( $parsed && isset( $parsed['query']['notifications'] ) ) { if ( $parsed && isset( $parsed['query']['notifications'] ) ) {
$results[$wiki] = $parsed['query']['notifications']; $results[$wiki] = $parsed['query']['notifications'];
} }
} else { }
if ( !isset( $results[$wiki] ) ) {
LoggerFactory::getInstance( 'Echo' )->warning( LoggerFactory::getInstance( 'Echo' )->warning(
"Failed to fetch notifications from {wiki}. Response: {response}", "Failed to fetch notifications from {wiki}. Response: {code} {response}",
array( array(
'wiki' => $wiki, 'wiki' => $wiki,
'code' => $response['response']['code'],
'response' => $response['response']['body'], 'response' => $response['response']['body'],
) )
); );