We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fb2283d commit 7f4ce19Copy full SHA for 7f4ce19
src/Libraries/Core/Config.php
@@ -110,9 +110,17 @@ public static function loadJson(): bool
110
return false;
111
}
112
113
- self::$json_config = \json_decode(
114
- \file_get_contents(self::JSON_CONFIG_PATH), true, self::JSON_FLAGS
115
- );
+ $buffer = \file_get_contents(self::JSON_CONFIG_PATH);
+ if ($buffer === false)
+ {
116
+ throw new \UnexpectedValueException('Cannot retrieve application JSON configuration');
117
+ }
118
+ self::$json_config = \json_decode($buffer, true, self::JSON_FLAGS);
119
+ $json_errno = \json_last_error();
120
+ if ($json_errno != \JSON_ERROR_NONE)
121
122
+ throw new \JsonException(\json_last_error_msg(), $json_errno);
123
124
125
return true;
126
0 commit comments