From de209ec0648867b2b67404e20748520e9e865938 Mon Sep 17 00:00:00 2001 From: epriestley Date: Tue, 15 Sep 2020 17:19:26 -0700 Subject: [PATCH] When raising a Conduit client exception, show the called method in the error message Summary: Ref T13581. This message can be slightly more helpful in some cases by showing which method call failed. Test Plan: Ran `arc branches` under the error condition in D21462, got a more useful error. Maniphest Tasks: T13581 Differential Revision: https://secure.phabricator.com/D21463 --- src/conduit/ConduitFuture.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/conduit/ConduitFuture.php b/src/conduit/ConduitFuture.php index 351d2d11..5966f42e 100644 --- a/src/conduit/ConduitFuture.php +++ b/src/conduit/ConduitFuture.php @@ -62,9 +62,14 @@ final class ConduitFuture extends FutureProxy { } if ($data['error_code']) { + $message = pht( + '<%s> %s', + $this->conduitMethod, + $data['error_info']); + throw new ConduitClientException( $data['error_code'], - $data['error_info']); + $message); } $result = $data['result'];