Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apps/discord-bot/src/lib/command.listener.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion apps/support-bot/src/lib/command.listener.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
5 changes: 4 additions & 1 deletion packages/api-client/src/api.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,10 @@ export class ApiService {
public getUser(tag: string) {
return this.request<GetUserResponse>("/user", { tag })
.then((data) => data.user ?? null)
.catch(() => null);
.catch((err) => {
if (axios.isAxiosError(err) && (!err.response || err.response.status >= 500)) throw err;
return null;
});
}

public updateUser(tag: string, update: UpdateUser) {
Expand Down
Loading