From 3fc06abe65279734911dfa8d94660ec33311d9e3 Mon Sep 17 00:00:00 2001 From: Cody <36463298+ugcodrr@users.noreply.github.com> Date: Sun, 1 Nov 2026 21:23:33 -0500 Subject: [PATCH 1/2] fix(support-bot): keep the member role when the API can't be reached --- apps/discord-bot/src/lib/command.listener.ts | 2 +- apps/support-bot/src/lib/command.listener.ts | 2 +- packages/api-client/src/api.service.ts | 3 +-- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/apps/discord-bot/src/lib/command.listener.ts b/apps/discord-bot/src/lib/command.listener.ts index a539a9cca..686e2bad9 100644 --- a/apps/discord-bot/src/lib/command.listener.ts +++ b/apps/discord-bot/src/lib/command.listener.ts @@ -75,7 +75,7 @@ export class CommandListener extends AbstractCommandListener { guild: interaction.getGuildId() ?? null, }); - const user = await this.apiService.getUser(id); + const user = await this.apiService.getUser(id).catch(() => null); Sentry.setUser({ id, diff --git a/apps/support-bot/src/lib/command.listener.ts b/apps/support-bot/src/lib/command.listener.ts index e1445a37f..02a922359 100644 --- a/apps/support-bot/src/lib/command.listener.ts +++ b/apps/support-bot/src/lib/command.listener.ts @@ -57,7 +57,7 @@ export class CommandListener extends AbstractCommandListener { parentData ); - const user = await this.apiService.getUser(id); + const user = await this.apiService.getUser(id).catch(() => null); const context = new CommandContext(this, interaction, data); context.setUser(user); diff --git a/packages/api-client/src/api.service.ts b/packages/api-client/src/api.service.ts index f43108367..c85ef7134 100644 --- a/packages/api-client/src/api.service.ts +++ b/packages/api-client/src/api.service.ts @@ -214,8 +214,7 @@ export class ApiService { public getUser(tag: string) { return this.request("/user", { tag }) - .then((data) => data.user ?? null) - .catch(() => null); + .then((data) => data.user ?? null); } public updateUser(tag: string, update: UpdateUser) { From 344b168ec1fde3d9cbe21e9ef7f1dd2a9eb908c2 Mon Sep 17 00:00:00 2001 From: Cody <36463298+ugcodrr@users.noreply.github.com> Date: Sun, 1 Nov 2026 22:35:55 -0500 Subject: [PATCH 2/2] fix(api-client): return null from getUser when the user isn't verified --- packages/api-client/src/api.service.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/api-client/src/api.service.ts b/packages/api-client/src/api.service.ts index c85ef7134..288668597 100644 --- a/packages/api-client/src/api.service.ts +++ b/packages/api-client/src/api.service.ts @@ -214,7 +214,11 @@ export class ApiService { public getUser(tag: string) { return this.request("/user", { tag }) - .then((data) => data.user ?? null); + .then((data) => data.user ?? null) + .catch((err) => { + if (axios.isAxiosError(err) && (!err.response || err.response.status >= 500)) throw err; + return null; + }); } public updateUser(tag: string, update: UpdateUser) {