1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-25 16:22:43 +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:
epriestley 2020-09-15 17:22:21 -07:00
parent 2a83df5786
commit 969587f7b0

View file

@ -100,9 +100,17 @@ final class PhabricatorConduitAPIController
} }
} catch (Exception $ex) { } catch (Exception $ex) {
$result = null; $result = null;
$error_code = ($ex instanceof ConduitException
? 'ERR-CONDUIT-CALL' if ($ex instanceof ConduitException) {
: 'ERR-CONDUIT-CORE'); $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(); $error_info = $ex->getMessage();
} }