Use exceptions for S3 error messages

Summary:
Right now, the "SimpleEmailService" class uses trigger_error() to communicate
error messages. This means they get lost in the error logs and aren't visible in
the MetaMTA interface.

Provide a flag to strengthen them into exceptions, instead.

(I've attempted to emulate the prevailing style so I can offer this upstream.)

Test Plan: Faked an error condition and got a detailed stack trace in MetaMTA
instead of an empty "Message" field.
Reviewed By: jungejason
Reviewers: hunterbridges, codeblock, jungejason, tuomaspelkonen, aran
CC: aran, jungejason
Differential Revision: 783
This commit is contained in:
epriestley
2011-08-04 08:09:43 -07:00
parent c7e1fa626d
commit d064c6efa8
2 changed files with 24 additions and 3 deletions

View File

@@ -42,6 +42,7 @@ class PhabricatorMailImplementationAmazonSESAdapter
require_once $root.'/externals/amazon-ses/ses.php';
$service = newv('SimpleEmailService', array($key, $secret));
$service->enableUseExceptions(true);
return $service->sendRawEmail($body);
}