]> khamidou — GitHub mirrors - arcanist.git/commitdiff
Stop this from failing on directories, etc.; u-u-u-u-ultra clown.
authorepriestley <epriestley@phabricator.com>
Mon, 11 Apr 2011 23:13:22 +0000 (16:13 -0700)
committerepriestley <epriestley@phabricator.com>
Mon, 11 Apr 2011 23:13:22 +0000 (16:13 -0700)
src/lint/engine/base/ArcanistLintEngine.php

index 35b4fe2a59cfc7d5c829aedfc4903f29895a98d3..472d43501031b2285bb6b8e4d481067b9ce7d7bd 100644 (file)
@@ -181,8 +181,14 @@ abstract class ArcanistLintEngine {
         // raised an error about its filename. We could refine this by looking
         // through the lint messages and doing this load only if any of them
         // have original/replacement text or something like that.
-        $this->fileData[$path] = Filesystem::readFile($path);
-        $result->setData($this->fileData[$path]);
+        try {
+          $this->fileData[$path] = Filesystem::readFile($path);
+          $result->setData($this->fileData[$path]);
+        } catch (FilesystemException $ex) {
+          // Ignore this, it's noncritical that we access this data and it
+          // might be unreadable or a directory or whatever else for plenty
+          // of legitimate reasons.
+        }
       }
     }