Page MenuHomestyx hydra

No OneTemporary

diff --git a/src/applications/repository/customfield/PhabricatorCommitBranchesField.php b/src/applications/repository/customfield/PhabricatorCommitBranchesField.php
index 0d430f36a6..63a807ea55 100644
--- a/src/applications/repository/customfield/PhabricatorCommitBranchesField.php
+++ b/src/applications/repository/customfield/PhabricatorCommitBranchesField.php
@@ -1,46 +1,53 @@
<?php
final class PhabricatorCommitBranchesField
extends PhabricatorCommitCustomField {
public function getFieldKey() {
return 'diffusion:branches';
}
public function getFieldName() {
return pht('Branches');
}
public function getFieldDescription() {
return pht('Shows branches a commit appears on in email.');
}
public function shouldAppearInTransactionMail() {
return true;
}
public function updateTransactionMailBody(
PhabricatorMetaMTAMailBody $body,
PhabricatorApplicationTransactionEditor $editor,
array $xactions) {
$params = array(
'contains' => $this->getObject()->getCommitIdentifier(),
'callsign' => $this->getObject()->getRepository()->getCallsign(),
);
- $branches_raw = id(new ConduitCall('diffusion.branchquery', $params))
- ->setUser($this->getViewer())
- ->execute();
-
- $branches = DiffusionRepositoryRef::loadAllFromDictionaries($branches_raw);
- if (!$branches) {
- return;
+ try {
+ $branches_raw = id(new ConduitCall('diffusion.branchquery', $params))
+ ->setUser($this->getViewer())
+ ->execute();
+
+ $branches = DiffusionRepositoryRef::loadAllFromDictionaries(
+ $branches_raw);
+ if (!$branches) {
+ return;
+ }
+
+ $branch_names = mpull($branches, 'getShortName');
+ sort($branch_names);
+ $branch_text = implode(', ', $branch_names);
+ } catch (Exception $ex) {
+ $branch_text = pht('<%s: %s>', get_class($ex), $ex->getMessage());
}
- $branch_names = mpull($branches, 'getShortName');
- sort($branch_names);
- $body->addTextSection(pht('BRANCHES'), implode(', ', $branch_names));
+ $body->addTextSection(pht('BRANCHES'), $branch_text);
}
}

File Metadata

Mime Type
text/x-diff
Expires
Thu, Aug 14, 3:52 AM (3 d, 7 h ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
196253
Default Alt Text
(2 KB)

Event Timeline