From b97cfed23a9f7dbda196b7420a94a7eb1b895083 Mon Sep 17 00:00:00 2001 From: vrana Date: Sat, 20 Oct 2012 07:08:26 -0700 Subject: [PATCH] Pass key to aggregate exception Summary: This information may be quite useful. Test Plan: Uploaded file. Reviewers: epriestley Reviewed By: epriestley CC: aran, Korvin Differential Revision: https://secure.phabricator.com/D3763 --- .../files/storage/PhabricatorFile.php | 14 +++++----- .../userguide/arcanist_extending_lint.diviner | 26 +++++-------------- 2 files changed, 14 insertions(+), 26 deletions(-) diff --git a/src/applications/files/storage/PhabricatorFile.php b/src/applications/files/storage/PhabricatorFile.php index 72e3612a74..2396483278 100644 --- a/src/applications/files/storage/PhabricatorFile.php +++ b/src/applications/files/storage/PhabricatorFile.php @@ -176,18 +176,18 @@ final class PhabricatorFile extends PhabricatorFileDAO { // We stored the file somewhere so stop trying to write it to other // places. break; - } catch (Exception $ex) { - if ($ex instanceof PhabricatorFileStorageConfigurationException) { - // If an engine is outright misconfigured (or misimplemented), raise - // that immediately since it probably needs attention. - throw $ex; - } + } catch (PhabricatorFileStorageConfigurationException $ex) { + // If an engine is outright misconfigured (or misimplemented), raise + // that immediately since it probably needs attention. + throw $ex; + + } catch (Exception $ex) { // If an engine doesn't work, keep trying all the other valid engines // in case something else works. phlog($ex); - $exceptions[] = $ex; + $exceptions[$engine_class] = $ex; } } diff --git a/src/docs/userguide/arcanist_extending_lint.diviner b/src/docs/userguide/arcanist_extending_lint.diviner index b10b47e9cb..a4966aeaa7 100644 --- a/src/docs/userguide/arcanist_extending_lint.diviner +++ b/src/docs/userguide/arcanist_extending_lint.diviner @@ -70,26 +70,14 @@ widths on different languages: $linters = array(); - $text_80col_linter = new ArcanistTextLinter(); - $linters[] = $text_80col_linter; + // Warn on JS/CSS lines longer than 80 columns. + $linters['TextLinter80Col'] = id(new ArcanistTextLinter()) + ->setPaths(preg_grep('/\.(js|css)$/', $paths)); - $text_120col_linter = new ArcanistTextLinter(); - $text_120col_linter->setMaxLineLength(120); - $linters[] = $text_120col_linter; - - foreach ($paths as $path) { - - // Warn on JS/CSS lines longer than 80 columns. - if (preg_match('/\.(js|css)$/', $path)) { - $text_80col_linter->addPath($path); - } - - // Warn on Java lines longer than 120 columns. - if (preg_match('/\.java$/', $path)) { - $text_120col_linter->addPath($path); - } - - } + // Warn on Java lines longer than 120 columns. + $linters['TextLinter120Col'] = id(new ArcanistTextLinter()) + ->setMaxLineLength(120) + ->setPaths(preg_grep('/\.(java)$/', $paths)); // ...