Log warning on failure to fetch foreign notifications

Change-Id: I92bc0ea2aebc1992d43dc0cd560137090b4d5857
This commit is contained in:
Stephane Bisson 2016-05-13 16:35:54 -04:00
parent 52b60075d1
commit f5e9d4e372

View file

@ -1,5 +1,7 @@
<?php
use MediaWiki\Logger\LoggerFactory;
class ApiEchoNotifications extends ApiQueryBase {
/**
* @var EchoForeignNotifications
@ -379,6 +381,14 @@ class ApiEchoNotifications extends ApiQueryBase {
if ( $parsed && isset( $parsed['query']['notifications'] ) ) {
$results[$wiki] = $parsed['query']['notifications'];
}
} else {
LoggerFactory::getInstance( 'Echo' )->warning(
"Failed to fetch notifications from {wiki}. Response: {response}",
array(
'wiki' => $wiki,
'response' => $response['response']['body'],
)
);
}
}