Diffusion - clean up catching ConduitException

Summary: Ref T7123. Turns out that we might throw ConduitClientException now in proxied scenarios. For all but one callsite remove the try / catch bit and don't issue the call for SVN. For the remaining callsite, also don't issue the call for SVN but keep in the exception logic since its renders a pretty error message in the non-proxied case?

Test Plan: played around with diffusion and things looked okay.

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin, epriestley

Maniphest Tasks: T7123

Differential Revision: https://secure.phabricator.com/D11789
This commit is contained in:
Bob Trahan
2015-02-17 14:01:17 -08:00
parent 3fcc3fdedf
commit 81d2f2686c
5 changed files with 83 additions and 85 deletions

View File

@@ -8,22 +8,22 @@ final class DiffusionCommitBranchesController extends DiffusionController {
protected function processDiffusionRequest(AphrontRequest $request) {
$drequest = $this->getDiffusionRequest();
$repository = $drequest->getRepository();
$branches = array();
try {
$branches = $this->callConduitWithDiffusionRequest(
'diffusion.branchquery',
array(
'contains' => $drequest->getCommit(),
));
} catch (ConduitException $ex) {
if ($ex->getMessage() != 'ERR-UNSUPPORTED-VCS') {
throw $ex;
}
switch ($repository->getVersionControlSystem()) {
case PhabricatorRepositoryType::REPOSITORY_TYPE_SVN:
$branches = array();
break;
default:
$branches = $this->callConduitWithDiffusionRequest(
'diffusion.branchquery',
array(
'contains' => $drequest->getCommit(),
));
break;
}
$branches = DiffusionRepositoryRef::loadAllFromDictionaries($branches);
$branch_links = array();
foreach ($branches as $branch) {
$branch_links[] = phutil_tag(