Catch exception if we try to log due to config.hjson error
This commit is contained in:
parent
0f6924a916
commit
8922bb6683
|
@ -62,7 +62,11 @@ module.exports = new class ConfigCache
|
||||||
parsed = hjson.parse(data);
|
parsed = hjson.parse(data);
|
||||||
this.cache.set(path, parsed);
|
this.cache.set(path, parsed);
|
||||||
} catch(e) {
|
} 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);
|
return cb(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue