Add exception when json files can not be read
parent
450095e61d
commit
17286e993c
|
@ -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);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue