1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-18 03:20:59 +01:00

Catch any exceptions thrown when handling mail

Summary:
This makes debugging issues a lot easier, since any exceptions thrown
gets logged and can be seen at /mail/received/, for inspection.

Test Plan:
Created a task via the public-author functionality, and saw no errors
without this patch applied. Even worse, the exception was never shown at
command line either. Not sure what's up with that. Output buffering, or
whatever?

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, epriestley, davidreuss

Differential Revision: 1042
This commit is contained in:
David Reuss 2011-10-28 08:05:27 -07:00 committed by epriestley
parent 4e900c096f
commit 13d15276a5

View file

@ -60,7 +60,15 @@ foreach ($parser->getAttachments() as $attachment) {
));
$attachments[] = $file->getPHID();
}
try {
$received->setAttachments($attachments);
$received->save();
$received->processReceivedMail();
} catch (Exception $e) {
$received
->setMessage('EXCEPTION: '.$e->getMessage())
->save();
}