]> khamidou — GitHub mirrors - arcanist.git/commitdiff
Improve exception raised when an event listener fails to load
authorepriestley <git@epriestley.com>
Wed, 20 Nov 2013 20:46:38 +0000 (12:46 -0800)
committerepriestley <git@epriestley.com>
Wed, 20 Nov 2013 20:46:38 +0000 (12:46 -0800)
Summary: See IRC. The failing class might not be the listener itself.

Test Plan:
  $ arc list
  ERROR: Failed to load event listener 'depr': Failed to load class or interface 'depr': the class or interface 'depr' is not defined in the library map for any loaded phutil library. If this symbol was recently added or moved, your library map may be out of date. You can rebuild the map by running 'arc liberate'. For more information, see: http://www.phabricator.com/docs/phabricator/article/libphutil_Libraries_User_Guide.html

Reviewers: btrahan

Reviewed By: btrahan

CC: aran
Differential Revision: https://secure.phabricator.com/D7616

scripts/arcanist.php

index 4e0051b3ae6e0a98106eb93aa3305944cbc2ae5e..3c4936b8928b1db56f8d7170a6a715b3eccc5213 100755 (executable)
@@ -304,10 +304,13 @@ try {
       } catch (PhutilMissingSymbolException $ex) {
         // Continue anwyay, since you may otherwise be unable to run commands
         // like `arc set-config events.listeners` in order to repair the damage
-        // you've caused.
+        // you've caused. We're writing out the entire exception here because
+        // it might not have been triggered by the listener itself (for example,
+        // the listener might use a bad class in its register() method).
         $console->writeErr(
-          "ERROR: Failed to load event listener '%s'!\n",
-          $listener);
+          "ERROR: Failed to load event listener '%s': %s\n",
+          $listener,
+          $ex->getMessage());
       }
     }
   }