From e4effebc196226c1d4580964bbb3077bcaaab07a Mon Sep 17 00:00:00 2001 From: Jacob Southard Date: Fri, 29 Dec 2023 10:04:59 -0600 Subject: [PATCH] Add try/catch to fileutils.getFileMtimeMs --- server/utils/fileUtils.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/server/utils/fileUtils.js b/server/utils/fileUtils.js index ebad97db..7ef5320d 100644 --- a/server/utils/fileUtils.js +++ b/server/utils/fileUtils.js @@ -81,7 +81,12 @@ module.exports.getFileSize = async (path) => { * @returns {Promise} epoch timestamp */ module.exports.getFileMTimeMs = async (path) => { - return (await getFileStat(path))?.mtimeMs || 0 + try { + return (await getFileStat(path))?.mtimeMs || 0 + } catch (err) { + Logger.error(`[fileUtils] Failed to getFileMtimeMs`, err) + return 0 + } } /**