From: vrana Date: Sat, 20 Oct 2012 14:11:02 +0000 (-0700) Subject: Pass key to aggregate exception X-Git-Tag: conduit-6~67 X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=835f2afb5d3b43ee424926b3f47b281ae4474388;p=arcanist.git Pass key to aggregate exception 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 --- diff --git a/src/lint/engine/ArcanistLintEngine.php b/src/lint/engine/ArcanistLintEngine.php index 8ea0755b..a0bba72f 100644 --- a/src/lint/engine/ArcanistLintEngine.php +++ b/src/lint/engine/ArcanistLintEngine.php @@ -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; } }