Merge pull request #3010 from overleaf/hb-handle-invalid-filepath-error

Provide specific error on invalid file path upload

GitOrigin-RevId: 4b26da398f18fc03e812ea081accd96f05244cef
This commit is contained in:
Alasdair Smith 2020-07-22 09:57:03 +01:00 committed by Copybot
parent 4e18a81944
commit 2bcbc84e0b

View file

@ -102,7 +102,12 @@ module.exports = ProjectUploadController = {
},
'error uploading file'
)
if (error.message === 'project_has_too_many_files') {
if (error.name === 'InvalidNameError') {
return res.send({
success: false,
error: req.i18n.translate('invalid_filename')
})
} else if (error.message === 'project_has_too_many_files') {
return res.send({
success: false,
error: req.i18n.translate('project_has_too_many_files')