diff --git a/ts/src/activities/discord.ts b/ts/src/activities/discord.ts index e914827..675f7d8 100644 --- a/ts/src/activities/discord.ts +++ b/ts/src/activities/discord.ts @@ -3,17 +3,12 @@ import { c } from '#/di' import type { InteractionRef } from '#/discord' import { InteractionResponseTypes } from '@discordeno/types' import { Bot } from '#/discord/bot' -import { ApplicationError } from '@temporalio/activity' +import { ApplicationFailure } from '@temporalio/common' import { logger } from '#/logger' const log = logger.child({ component: 'discord-activity' }) -// Custom error class for non-retryable Discord errors -export class DiscordInteractionExpiredError extends ApplicationError { - constructor(message: string) { - super(message, { nonRetryable: true }) - } -} +// We don't need a custom error class anymore, we'll use ApplicationFailure.nonRetryable() // from https://github.com/discordeno/discordeno/blob/21.0.0/packages/bot/src/transformers/interaction.ts#L33 export const reply_to_interaction = async (props: { @@ -59,8 +54,9 @@ export const reply_to_interaction = async (props: { ) // Throw non-retryable error to prevent Temporal from retrying - throw new DiscordInteractionExpiredError( - `Discord interaction ${ref.id} has expired and cannot be responded to` + throw ApplicationFailure.nonRetryable( + `Discord interaction ${ref.id} has expired and cannot be responded to`, + 'DiscordInteractionExpired' ) } diff --git a/ts/src/workflows/guild_messages.ts b/ts/src/workflows/guild_messages.ts index 04ed0c4..2380a9b 100644 --- a/ts/src/workflows/guild_messages.ts +++ b/ts/src/workflows/guild_messages.ts @@ -19,8 +19,8 @@ export async function handleCommandGuildInfo(payload: CommandPayload): Promise