From b38d6a85c9268f26600b44c67ad153d2c27bae96 Mon Sep 17 00:00:00 2001 From: Alf Eaton Date: Fri, 26 Jan 2024 09:28:51 +0000 Subject: [PATCH] Warn when project or file is not found (#16740) GitOrigin-RevId: ab71000492c3b2f2ba02ad6fd768b7c2e4563ed7 --- .../src/Features/FileStore/FileStoreController.js | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/services/web/app/src/Features/FileStore/FileStoreController.js b/services/web/app/src/Features/FileStore/FileStoreController.js index 71a281f9dc..e4dd34bcd7 100644 --- a/services/web/app/src/Features/FileStore/FileStoreController.js +++ b/services/web/app/src/Features/FileStore/FileStoreController.js @@ -15,10 +15,17 @@ module.exports = { { project_id: projectId, element_id: fileId, type: 'file' }, function (err, file) { if (err) { - logger.err( - { err, projectId, fileId, queryString }, - 'error finding element for downloading file' - ) + if (err.name === 'NotFoundError') { + logger.warn( + { err, projectId, fileId, queryString }, + 'entity not found when downloading file' + ) + } else { + logger.err( + { err, projectId, fileId, queryString }, + 'error finding element for downloading file' + ) + } return res.sendStatus(500) } FileStoreHandler.getFileStream(