From c6a4c2882d89c6bcceeeccd319549611a5d1801b Mon Sep 17 00:00:00 2001 From: ArthurHoaro Date: Sun, 12 Mar 2017 16:09:34 +0100 Subject: Proper error if the conf file is invalid instead of fatal error MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Error: An error occurred while parsing configuration JSON file (data/config.json.php): error code #4 ➜ Syntax error Please check your JSON syntax (without PHP comment tags) using a JSON lint tool such as jsonlint.com. --- application/config/ConfigManager.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'application/config/ConfigManager.php') diff --git a/application/config/ConfigManager.php b/application/config/ConfigManager.php index f2097410..e98af8ab 100644 --- a/application/config/ConfigManager.php +++ b/application/config/ConfigManager.php @@ -81,7 +81,11 @@ class ConfigManager */ protected function load() { - $this->loadedConfig = $this->configIO->read($this->getConfigFileExt()); + try { + $this->loadedConfig = $this->configIO->read($this->getConfigFileExt()); + } catch (\Exception $e) { + die($e->getMessage()); + } $this->setDefaultValues(); } -- cgit v1.2.3