1
0
Fork 0
mirror of https://we.phorge.it/source/arcanist.git synced 2024-11-22 06:42:41 +01:00

In ConduitCallFuture, only call Conduit exception messages on Conduit exceptions

Summary: Ref T13582. When this code is reached with a raw HTTP exception, it currently fatals.

Test Plan:
  - Ran `arc branches --conduit-uri=http://example.org` (a bad Conduit URI).
  - Before: hard fatal with a bad method call.
  - After: non-Conduit exception raised to user. Not ideal, but a step forward.

Maniphest Tasks: T13582

Differential Revision: https://secure.phabricator.com/D21467
This commit is contained in:
epriestley 2020-09-17 13:11:23 -07:00
parent 8e5e49984d
commit 563dc2a993

View file

@ -72,15 +72,18 @@ final class ArcanistConduitCallFuture
} }
protected function didReceiveException($exception) { protected function didReceiveException($exception) {
switch ($exception->getErrorCode()) {
case 'ERR-INVALID-SESSION': if ($exception instanceof ConduitClientException) {
if (!$this->getEngine()->getConduitToken()) { switch ($exception->getErrorCode()) {
$this->raiseLoginRequired(); case 'ERR-INVALID-SESSION':
} if (!$this->getEngine()->getConduitToken()) {
break; $this->raiseLoginRequired();
case 'ERR-INVALID-AUTH': }
$this->raiseInvalidAuth(); break;
break; case 'ERR-INVALID-AUTH':
$this->raiseInvalidAuth();
break;
}
} }
throw $exception; throw $exception;