Warn when project or file is not found (#16740)
GitOrigin-RevId: ab71000492c3b2f2ba02ad6fd768b7c2e4563ed7
This commit is contained in:
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user