1
0
Fork 0

Add exception when json files can not be read

pull/61/head
Jordi Boggiano 2011-10-22 22:18:44 +02:00
parent 450095e61d
commit 17286e993c
1 changed files with 3 additions and 0 deletions

View File

@ -58,6 +58,9 @@ class JsonFile
)); ));
$json = file_get_contents($this->path, false, $context); $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); return static::parseJson($json);
} }