* uploadController.js: expect some multer error codes and don't log their stack traces to console when they occur.

* yarn.lock: added integrity field (yarn's new addition).
This commit is contained in:
Bobby Wibowo 2018-10-08 23:14:10 +07:00
parent 94255700be
commit e2831f2181
No known key found for this signature in database
GPG Key ID: 51C3A1E1E22D26CF
2 changed files with 474 additions and 1 deletions

View File

@ -163,7 +163,14 @@ uploadsController.actuallyUpload = async (req, res, user, albumid) => {
} }
upload(req, res, async error => { upload(req, res, async error => {
if (error) { return erred(error) } if (error) {
const expected = [
'LIMIT_FILE_SIZE',
'LIMIT_UNEXPECTED_FILE'
]
if (expected.includes(error.code)) { return erred(error.toString()) }
return erred(error)
}
if (!req.files || !req.files.length) { return erred('No files.') } if (!req.files || !req.files.length) { return erred('No files.') }

466
yarn.lock

File diff suppressed because it is too large Load Diff