mirror of
https://github.com/zadam/trilium.git
synced 2025-11-13 16:55:50 +01:00
don't error out when backend log does not exist yet, fixes #1977
This commit is contained in:
@@ -7,7 +7,13 @@ const {LOG_DIR} = require('../../services/data_dir.js');
|
||||
function getBackendLog() {
|
||||
const file = `${LOG_DIR}/trilium-${dateUtils.localNowDate()}.log`;
|
||||
|
||||
return fs.readFileSync(file, 'utf8');
|
||||
try {
|
||||
return fs.readFileSync(file, 'utf8');
|
||||
}
|
||||
catch (e) {
|
||||
// most probably the log file does not exist yet - https://github.com/zadam/trilium/issues/1977
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
|
||||
Reference in New Issue
Block a user