From 8922bb66834c0e9cb66da5caad30ed00fa63c11b Mon Sep 17 00:00:00 2001 From: Bryan Ashby Date: Wed, 4 Jul 2018 17:58:38 -0600 Subject: [PATCH] Catch exception if we try to log due to config.hjson error --- core/config_cache.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/core/config_cache.js b/core/config_cache.js index e8e06f14..62c6bb55 100644 --- a/core/config_cache.js +++ b/core/config_cache.js @@ -62,7 +62,11 @@ module.exports = new class ConfigCache parsed = hjson.parse(data); this.cache.set(path, parsed); } catch(e) { - require('./logger.js').log.error( { filePath : path, error : e.message }, 'Failed to re-cache' ); + try { + require('./logger.js').log.error( { filePath : path, error : e.message }, 'Failed to re-cache' ); + } catch(ignored) { + // nothing - we may be failing to parse the config in which we can't log here! + } return cb(e); }