mirror of
https://github.com/BobbyWibowo/lolisafe.git
synced 2025-01-19 01:31:34 +00:00
Updates
* 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:
parent
94255700be
commit
e2831f2181
@ -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.') }
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user