From 9b129be52430bb42cc6a92c3c9faa94f2e75c7c8 Mon Sep 17 00:00:00 2001 From: ThatOneCalculator Date: Tue, 25 Apr 2023 08:31:05 -0700 Subject: [PATCH] throw different error if following is null --- .../backend/src/server/api/endpoints/users/following.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/backend/src/server/api/endpoints/users/following.ts b/packages/backend/src/server/api/endpoints/users/following.ts index 967379d0c4..fbfaf6173d 100644 --- a/packages/backend/src/server/api/endpoints/users/following.ts +++ b/packages/backend/src/server/api/endpoints/users/following.ts @@ -37,6 +37,11 @@ export const meta = { code: "FORBIDDEN", id: "f6cdb0df-c19f-ec5c-7dbb-0ba84a1f92ba", }, + cannot_find: { + message: "Cannot find the following.", + code: "CANNOT_FIND", + id: "7a55f0d7-8e06-4a7e-9c77-ee7d59b25a82", + } }, } as const; @@ -97,7 +102,7 @@ export default define(meta, paramDef, async (ps, me) => { followerId: me.id, }); if (following == null) { - throw new ApiError(meta.errors.forbidden); + throw new ApiError(meta.errors.cannot_find); } } }