aboutsummaryrefslogtreecommitdiffhomepage
path: root/application/config/ConfigManager.php
diff options
context:
space:
mode:
authorArthurHoaro <arthur@hoa.ro>2017-03-12 16:09:34 +0100
committerArthurHoaro <arthur@hoa.ro>2017-03-12 16:09:34 +0100
commitc6a4c2882d89c6bcceeeccd319549611a5d1801b (patch)
treed402f0c42c04a480b086d354951ad1f0c8732696 /application/config/ConfigManager.php
parent7fc5f07492b9bfe58cb33907ceb42e9bccd624ce (diff)
downloadShaarli-c6a4c2882d89c6bcceeeccd319549611a5d1801b.tar.gz
Shaarli-c6a4c2882d89c6bcceeeccd319549611a5d1801b.tar.zst
Shaarli-c6a4c2882d89c6bcceeeccd319549611a5d1801b.zip
Proper error if the conf file is invalid instead of fatal error
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.
Diffstat (limited to 'application/config/ConfigManager.php')
-rw-r--r--application/config/ConfigManager.php6
1 files changed, 5 insertions, 1 deletions
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
81 */ 81 */
82 protected function load() 82 protected function load()
83 { 83 {
84 $this->loadedConfig = $this->configIO->read($this->getConfigFileExt()); 84 try {
85 $this->loadedConfig = $this->configIO->read($this->getConfigFileExt());
86 } catch (\Exception $e) {
87 die($e->getMessage());
88 }
85 $this->setDefaultValues(); 89 $this->setDefaultValues();
86 } 90 }
87 91