fix(plugin-fm): fix error log (#3038)

This commit is contained in:
Junyi 2023-11-14 16:54:19 +08:00 committed by GitHub
parent 57c7450e16
commit 52c3f28c04
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 2 additions and 5 deletions

View File

@ -228,7 +228,7 @@ export const toItem = (file) => {
}; };
export const toFileList = (fileList: any) => { export const toFileList = (fileList: any) => {
return toArr(fileList?.filter(Boolean)).map(toItem); return toArr(fileList).filter(Boolean).map(toItem);
}; };
export const toValue = (fileList: any) => { export const toValue = (fileList: any) => {

View File

@ -18,10 +18,6 @@ export class ErrorHandler {
}, },
], ],
}; };
if (ctx.status === 500) {
console.error(err);
}
} }
middleware() { middleware() {

View File

@ -78,6 +78,7 @@ async function multipart(ctx: Context, next: Next) {
if (err.name === 'MulterError') { if (err.name === 'MulterError') {
return ctx.throw(400, err); return ctx.throw(400, err);
} }
ctx.logger.error(err);
return ctx.throw(500); return ctx.throw(500);
} }