Warn when project or file is not found (#16740)

GitOrigin-RevId: ab71000492c3b2f2ba02ad6fd768b7c2e4563ed7
This commit is contained in:
Alf Eaton 2024-01-26 09:28:51 +00:00 committed by Copybot
parent fefec2c1bf
commit b38d6a85c9

View file

@ -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(