From 43ce51ce2a73babbf71d4af69e64c558f12a2d5d Mon Sep 17 00:00:00 2001 From: wangsijie Date: Tue, 23 Jan 2024 11:58:29 +0800 Subject: [PATCH] fix(core): should throw 500 on file upload error (#5274) --- packages/core/src/routes/user-assets.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/core/src/routes/user-assets.ts b/packages/core/src/routes/user-assets.ts index 745d382e9..e38b6a444 100644 --- a/packages/core/src/routes/user-assets.ts +++ b/packages/core/src/routes/user-assets.ts @@ -87,7 +87,10 @@ export default function userAssetsRoutes(...[router]: Ro ctx.body = result; } catch { - throw new RequestError('storage.upload_error'); + throw new RequestError({ + code: 'storage.upload_error', + status: 500, + }); } return next();