From 0cfe5ca2698300ea8bbbce5a86578cc3d463ab28 Mon Sep 17 00:00:00 2001 From: Erik Bernhardson Date: Tue, 30 Sep 2014 15:52:06 -0700 Subject: [PATCH] Don't fatal if a notification fails to initialize Log info to Echo debug log group instead. Bug: 71489 Change-Id: I4a7c669ef55936e3c683d268041d828b54a5a9b2 --- includes/mapper/NotificationMapper.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/includes/mapper/NotificationMapper.php b/includes/mapper/NotificationMapper.php index 6f8539ea0..ecad61bec 100644 --- a/includes/mapper/NotificationMapper.php +++ b/includes/mapper/NotificationMapper.php @@ -171,7 +171,13 @@ class EchoNotificationMapper extends EchoAbstractMapper { if ( $res ) { foreach ( $res as $row ) { - $data[$row->event_id] = EchoNotification::newFromRow( $row ); + try { + $data[$row->event_id] = EchoNotification::newFromRow( $row ); + } catch ( Exception $e ) { + $id = isset( $row->event_id ) ? $row->event_id : 'unknown event'; + wfDebugLog( 'Echo', __METHOD__ . ": Failed initializing event: $id" ); + MWExceptionHandler::logException( $e ); + } } } return $data;