]> khamidou — GitHub mirrors - arcanist.git/commitdiff
Catch "ConduitClientException", not "Exception", in "arc patch"
authorepriestley <git@epriestley.com>
Wed, 7 Mar 2012 04:14:34 +0000 (20:14 -0800)
committerepriestley <git@epriestley.com>
Wed, 7 Mar 2012 04:14:34 +0000 (20:14 -0800)
Summary: This may raise other types of exceptions, e.g. http/network exceptions, where getErrorCode() is not defined.

Test Plan: Reasoned about beahvior.

Reviewers: btrahan

Reviewed By: btrahan

CC: aran, epriestley
Differential Revision: https://secure.phabricator.com/D1804

src/workflow/patch/ArcanistPatchWorkflow.php

index daa6a55c64982411784b03b861d547fcde2f3c6b..de4d025bed620127c096266563e450a6c07423df 100644 (file)
@@ -349,7 +349,7 @@ EOTEXT
             $param);
           break;
       }
-    } catch (Exception $ex) {
+    } catch (ConduitClientException $ex) {
       if ($ex->getErrorCode() == 'ERR-INVALID-SESSION') {
         // Phabricator is not configured to allow anonymous access to
         // Differential.