mirror of
https://github.com/NuSkooler/enigma-bbs.git
synced 2025-06-12 07:34:41 +02:00
Catch exception if we try to log due to config.hjson error
This commit is contained in:
parent
0f6924a916
commit
8922bb6683
1 changed files with 5 additions and 1 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue