mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-10 00:42:41 +01:00
Fix several issues with Differential exception email
Summary: - Assigning $cc_phids clobbers the correct value assigned on line 80. - Remove stack trace noise, the trace is always meaningless and well-known. - Actually show the original body. Test Plan: Piped mail to the mail receiver and verified the errors didn't CC revision CCs, no longer had traces, and included the original raw text body. Reviewers: btrahan, jungejason Reviewed By: jungejason CC: aran Differential Revision: https://secure.phabricator.com/D2969
This commit is contained in:
parent
241c810916
commit
2b690372de
4 changed files with 6 additions and 6 deletions
|
@ -162,7 +162,7 @@ class DifferentialReplyHandler extends PhabricatorMailReplyHandler {
|
|||
$exception_mail = new DifferentialExceptionMail(
|
||||
$this->getMailReceiver(),
|
||||
$ex,
|
||||
$body);
|
||||
$this->receivedMail->getRawTextBody());
|
||||
|
||||
$exception_mail->setToPHIDs(array($this->getActor()->getPHID()));
|
||||
$exception_mail->send();
|
||||
|
|
|
@ -45,16 +45,13 @@ final class DifferentialExceptionMail extends DifferentialMail {
|
|||
$original_body = $this->originalBody;
|
||||
|
||||
$message = $exception->getMessage();
|
||||
$trace = $exception->getTraceAsString();
|
||||
|
||||
return <<<EOBODY
|
||||
Your request failed because an exception was encoutered while processing it:
|
||||
|
||||
EXCEPTION: {$message}
|
||||
|
||||
{$trace}
|
||||
|
||||
-- Original Body --------------------------
|
||||
-- Original Body -------------------------------------------------------------
|
||||
|
||||
{$original_body}
|
||||
|
||||
|
|
|
@ -124,7 +124,6 @@ abstract class DifferentialMail {
|
|||
'<'.implode('>, <', $reviewer_phids).'>');
|
||||
}
|
||||
|
||||
$cc_phids = $revision->getCCPHIDs();
|
||||
if ($cc_phids) {
|
||||
$template->addPHIDHeaders('X-Differential-CC', $cc_phids);
|
||||
$template->addHeader(
|
||||
|
|
|
@ -222,6 +222,10 @@ final class PhabricatorMetaMTAReceivedMail extends PhabricatorMetaMTADAO {
|
|||
return $parser->stripTextBody($body);
|
||||
}
|
||||
|
||||
public function getRawTextBody() {
|
||||
return idx($this->bodies, 'text');
|
||||
}
|
||||
|
||||
public static function loadReceiverObject($receiver_name) {
|
||||
if (!$receiver_name) {
|
||||
return null;
|
||||
|
|
Loading…
Reference in a new issue