]> khamidou — GitHub mirrors - arcanist.git/commitdiff
Suggest upgrading Phabricator for unknown Conduit methods or parameters
authorvrana <jakubv@fb.com>
Sat, 15 Dec 2012 01:40:57 +0000 (17:40 -0800)
committervrana <jakubv@fb.com>
Sat, 15 Dec 2012 02:16:01 +0000 (18:16 -0800)
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
src/workflow/ArcanistLintWorkflow.php

index efe9ef2bff3d0c93722e68385f166ea71eb472ae..bd787cea495759c05800d6599e5c6ee3473f3a8a 100644 (file)
@@ -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,
index 2ad678abd35b7a3a64ba10d07f465acab07ff576..e83a1fc397cb59b63258a16b7f8de0162e2ec443 100644 (file)
@@ -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();