]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - scripts/maildaemon.php
Merge branch '0.8.x' into 0.9.x
[quix0rs-gnu-social.git] / scripts / maildaemon.php
index 5705cfd50e300fcf095d5cb55cc281bb957bc707..586bef624ea154d2a53d60c7a71d7313cd18bf83 100755 (executable)
@@ -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);