mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-10 00:42:41 +01:00
Log unexpected exceptions raised by Conduit calls
Summary: Ref T13581. Currently, unexpected exceptions inside Conduit calls are passed to the client, but not logged on the server. These exceptions should generally be unexpected, and producing a server-side trace is potentially useful. Test Plan: Simulated a during-execution exception, saw it get logged on the server. Maniphest Tasks: T13581 Differential Revision: https://secure.phabricator.com/D21464
This commit is contained in:
parent
2a83df5786
commit
969587f7b0
1 changed files with 11 additions and 3 deletions
|
@ -100,9 +100,17 @@ final class PhabricatorConduitAPIController
|
|||
}
|
||||
} catch (Exception $ex) {
|
||||
$result = null;
|
||||
$error_code = ($ex instanceof ConduitException
|
||||
? 'ERR-CONDUIT-CALL'
|
||||
: 'ERR-CONDUIT-CORE');
|
||||
|
||||
if ($ex instanceof ConduitException) {
|
||||
$error_code = 'ERR-CONDUIT-CALL';
|
||||
} else {
|
||||
$error_code = 'ERR-CONDUIT-CORE';
|
||||
|
||||
// See T13581. When a Conduit method raises an uncaught exception
|
||||
// other than a "ConduitException", log it.
|
||||
phlog($ex);
|
||||
}
|
||||
|
||||
$error_info = $ex->getMessage();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue