From 5f5392df8a40dc0e2294db94ad5fd9853d278123 Mon Sep 17 00:00:00 2001 From: vrana Date: Fri, 14 Dec 2012 17:40:57 -0800 Subject: [PATCH] Suggest upgrading Phabricator for unknown Conduit methods or parameters Summary: This allows using new methods without the need for bumping version number. The usage is not neccessary because we already bumped the version number for this but I wanted to have a callsite. Test Plan: Made a typo in method name, then: $ arc lint --only-new 1 Reviewers: epriestley Reviewed By: epriestley CC: aran, Korvin Differential Revision: https://secure.phabricator.com/D4193 --- src/workflow/ArcanistBaseWorkflow.php | 15 +++++++++++++++ src/workflow/ArcanistLintWorkflow.php | 2 +- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/src/workflow/ArcanistBaseWorkflow.php b/src/workflow/ArcanistBaseWorkflow.php index efe9ef2b..bd787cea 100644 --- a/src/workflow/ArcanistBaseWorkflow.php +++ b/src/workflow/ArcanistBaseWorkflow.php @@ -1466,6 +1466,21 @@ abstract class ArcanistBaseWorkflow { return $parser; } + protected function resolveCall(ConduitFuture $method, $timeout = null) { + try { + return $method->resolve($timeout); + } catch (ConduitClientException $ex) { + if ($ex->getErrorCode() == 'ERR-CONDUIT-CALL') { + echo phutil_console_wrap( + "This feature requires a newer version of Phabricator. Please ". + "update it using these instructions: ". + "http://www.phabricator.com/docs/phabricator/article/". + "Installation_Guide.html#updating-phabricator\n\n"); + } + throw $ex; + } + } + protected function dispatchEvent($type, array $data) { $data += array( 'workflow' => $this, diff --git a/src/workflow/ArcanistLintWorkflow.php b/src/workflow/ArcanistLintWorkflow.php index 2ad678ab..e83a1fc3 100644 --- a/src/workflow/ArcanistLintWorkflow.php +++ b/src/workflow/ArcanistLintWorkflow.php @@ -293,7 +293,7 @@ EOTEXT $timeout = 0; } - $raw_messages = $lint_future->resolve($timeout); + $raw_messages = $this->resolveCall($lint_future, $timeout); if ($raw_messages && $total) { $old_messages = array(); $line_maps = array(); -- 2.43.0