]> khamidou — GitHub mirrors - arcanist.git/commitdiff
Pass key to aggregate exception
authorvrana <jakubv@fb.com>
Sat, 20 Oct 2012 14:11:02 +0000 (07:11 -0700)
committervrana <jakubv@fb.com>
Sat, 20 Oct 2012 14:33:56 +0000 (07:33 -0700)
Summary: This information may be quite useful.

Test Plan: Threw exception from license linter.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin
Differential Revision: https://secure.phabricator.com/D3764

src/lint/engine/ArcanistLintEngine.php

index 8ea0755bc72b80e8f299a301674533f5b9b7646d..a0bba72f342f60780c81d3067b32ba5fbd0d63a2 100644 (file)
@@ -197,7 +197,7 @@ abstract class ArcanistLintEngine {
     }
 
     $exceptions = array();
-    foreach ($linters as $linter) {
+    foreach ($linters as $linter_name => $linter) {
       try {
         $linter->setEngine($this);
         if (!$linter->canRun()) {
@@ -238,7 +238,10 @@ abstract class ArcanistLintEngine {
           $result->addMessage($message);
         }
       } catch (Exception $ex) {
-        $exceptions[] = $ex;
+        if (!is_string($linter_name)) {
+          $linter_name = get_class($linter);
+        }
+        $exceptions[$linter_name] = $ex;
       }
     }