From 17286e993c850ca5f54e8b23e6fc3f486981c0b2 Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Sat, 22 Oct 2011 22:18:44 +0200 Subject: [PATCH] Add exception when json files can not be read --- src/Composer/Json/JsonFile.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Composer/Json/JsonFile.php b/src/Composer/Json/JsonFile.php index 3aeadc60f..8950545d2 100644 --- a/src/Composer/Json/JsonFile.php +++ b/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); }