mirror of
https://we.phorge.it/source/arcanist.git
synced 2024-11-21 22:32: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:
parent
8e5e49984d
commit
563dc2a993
1 changed files with 12 additions and 9 deletions
|
@ -72,15 +72,18 @@ final class ArcanistConduitCallFuture
|
|||
}
|
||||
|
||||
protected function didReceiveException($exception) {
|
||||
switch ($exception->getErrorCode()) {
|
||||
case 'ERR-INVALID-SESSION':
|
||||
if (!$this->getEngine()->getConduitToken()) {
|
||||
$this->raiseLoginRequired();
|
||||
}
|
||||
break;
|
||||
case 'ERR-INVALID-AUTH':
|
||||
$this->raiseInvalidAuth();
|
||||
break;
|
||||
|
||||
if ($exception instanceof ConduitClientException) {
|
||||
switch ($exception->getErrorCode()) {
|
||||
case 'ERR-INVALID-SESSION':
|
||||
if (!$this->getEngine()->getConduitToken()) {
|
||||
$this->raiseLoginRequired();
|
||||
}
|
||||
break;
|
||||
case 'ERR-INVALID-AUTH':
|
||||
$this->raiseInvalidAuth();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
throw $exception;
|
||||
|
|
Loading…
Reference in a new issue