Browse Source

Add exception when json files can not be read

Jordi Boggiano 13 years ago
parent
commit
17286e993c
1 changed files with 3 additions and 0 deletions
  1. 3 0
      src/Composer/Json/JsonFile.php

+ 3 - 0
src/Composer/Json/JsonFile.php

@@ -58,6 +58,9 @@ class JsonFile
         ));
 
         $json = file_get_contents($this->path, false, $context);
+        if (!$json) {
+            throw new \RuntimeException('Could not read '.$this->path.', you are probably offline');
+        }
 
         return static::parseJson($json);
     }