From 59df3e76742df11d8e0d94d42f2e87bddc50655c Mon Sep 17 00:00:00 2001 From: ben Date: Wed, 28 Jan 2009 18:01:31 +0000 Subject: notify_user now traps exceptions and logs them. git-svn-id: https://code.elgg.org/elgg/trunk@2625 36083f99-b078-4883-b0ff-0f9b5a30f544 --- engine/lib/notification.php | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'engine/lib/notification.php') diff --git a/engine/lib/notification.php b/engine/lib/notification.php index 2b847a5fa..de3c64bef 100644 --- a/engine/lib/notification.php +++ b/engine/lib/notification.php @@ -112,14 +112,18 @@ if ($CONFIG->debug) error_log("Sending message to $guid using $method"); - // Trigger handler and retrieve result. - $result[$guid][$method] = $handler( - $from ? get_entity($from) : NULL, // From entity - get_entity($guid), // To entity - $subject, // The subject - $message, // Message - $params // Params - ); + // Trigger handler and retrieve result. + try { + $result[$guid][$method] = $handler( + $from ? get_entity($from) : NULL, // From entity + get_entity($guid), // To entity + $subject, // The subject + $message, // Message + $params // Params + ); + } catch (Exception $e) { + error_log($e->getMessage()); + } } } -- cgit v1.2.3