From a6958da0917ebe981b18f0feefe65a51cef30b6d Mon Sep 17 00:00:00 2001 From: syuilo Date: Sat, 18 Sep 2021 17:58:37 +0900 Subject: [PATCH] =?UTF-8?q?enhance(server):=20=E3=82=A2=E3=82=AB=E3=82=A6?= =?UTF-8?q?=E3=83=B3=E3=83=88=E3=81=8C=E5=87=8D=E7=B5=90=E3=81=95=E3=82=8C?= =?UTF-8?q?=E3=81=9F=E3=81=A8=E3=81=8D=E3=81=AE=E3=82=A8=E3=83=A9=E3=83=BC?= =?UTF-8?q?=E3=82=92=E5=88=A4=E5=AE=9A=E3=81=97=E3=82=84=E3=81=99=E3=81=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/server/api/call.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/server/api/call.ts b/src/server/api/call.ts index 2768bde07e..bd86ffdc35 100644 --- a/src/server/api/call.ts +++ b/src/server/api/call.ts @@ -40,7 +40,12 @@ export default async (endpoint: string, user: User | null | undefined, token: Ac } if (ep.meta.requireCredential && user!.isSuspended) { - throw new ApiError(accessDenied, { reason: 'Your account has been suspended.' }); + throw new ApiError({ + message: 'Your account has been suspended.', + code: 'YOUR_ACCOUNT_SUSPENDED', + id: 'a8c724b3-6e9c-4b46-b1a8-bc3ed6258370', + httpStatusCode: 403 + }); } if (ep.meta.requireAdmin && !user!.isAdmin) {