@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Provide a separate error code for invalid Conduit calls

Summary: I plan to use this in Arcanist.

Test Plan:
$ echo '{}' | arc call-conduit x

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D4192

vrana a0e93fd4 d2cf71c5

+5 -3
+2 -2
src/applications/conduit/call/ConduitCall.php
··· 70 70 // Discard, we provide a more specific exception below. 71 71 } 72 72 if (!$ok) { 73 - throw new Exception( 73 + throw new ConduitException( 74 74 "Conduit method '{$method}' does not exist."); 75 75 } 76 76 77 77 $class_info = new ReflectionClass($method_class); 78 78 if ($class_info->isAbstract()) { 79 - throw new Exception( 79 + throw new ConduitException( 80 80 "Method '{$method}' is not valid; the implementation is an abstract ". 81 81 "base class."); 82 82 }
+3 -1
src/applications/conduit/controller/PhabricatorConduitAPIController.php
··· 108 108 } catch (Exception $ex) { 109 109 phlog($ex); 110 110 $result = null; 111 - $error_code = 'ERR-CONDUIT-CORE'; 111 + $error_code = ($ex instanceof ConduitException 112 + ? 'ERR-CONDUIT-CALL' 113 + : 'ERR-CONDUIT-CORE'); 112 114 $error_info = $ex->getMessage(); 113 115 } 114 116