summaryrefslogtreecommitdiff
path: root/scripts/maildaemon.php
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/maildaemon.php')
-rwxr-xr-xscripts/maildaemon.php9
1 files changed, 5 insertions, 4 deletions
diff --git a/scripts/maildaemon.php b/scripts/maildaemon.php
index 5705cfd50..586bef624 100755
--- a/scripts/maildaemon.php
+++ b/scripts/maildaemon.php
@@ -260,10 +260,11 @@ class MailerDaemon
function add_notice($user, $msg, $fileRecords)
{
- $notice = Notice::saveNew($user->id, $msg, 'mail');
- if (is_string($notice)) {
- $this->log(LOG_ERR, $notice);
- return $notice;
+ try {
+ $notice = Notice::saveNew($user->id, $msg, 'mail');
+ } catch (Exception $e) {
+ $this->log(LOG_ERR, $e->getMessage());
+ return $e->getMessage();
}
foreach($fileRecords as $fileRecord){
$this->attachFile($notice, $fileRecord);