noot
This commit is contained in:
parent
8dce848d3a
commit
5de260813b
@ -44,34 +44,34 @@ export const reply_to_interaction = async (props: {
|
|||||||
if (error.status === 404 || error.code === 10062) {
|
if (error.status === 404 || error.code === 10062) {
|
||||||
// 10062 is Discord's "Unknown interaction" error code
|
// 10062 is Discord's "Unknown interaction" error code
|
||||||
log.warn(
|
log.warn(
|
||||||
{
|
{
|
||||||
interactionId: ref.id,
|
interactionId: ref.id,
|
||||||
error: error.message,
|
error: error.message,
|
||||||
code: error.code,
|
code: error.code,
|
||||||
status: error.status
|
status: error.status
|
||||||
},
|
},
|
||||||
'Discord interaction expired (404) - not retrying'
|
'Discord interaction expired (404) - not retrying'
|
||||||
)
|
)
|
||||||
|
|
||||||
// Throw non-retryable error to prevent Temporal from retrying
|
// Throw non-retryable error to prevent Temporal from retrying
|
||||||
throw ApplicationFailure.nonRetryable(
|
throw ApplicationFailure.nonRetryable(
|
||||||
`Discord interaction ${ref.id} has expired and cannot be responded to`,
|
`Discord interaction ${ref.id} has expired and cannot be responded to`,
|
||||||
'DiscordInteractionExpired'
|
'DiscordInteractionExpired'
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Log other errors and re-throw them (these will be retried by Temporal)
|
// Log other errors and re-throw them (these will be retried by Temporal)
|
||||||
log.error(
|
log.error(
|
||||||
{
|
{
|
||||||
interactionId: ref.id,
|
interactionId: ref.id,
|
||||||
error: error.message,
|
error: error.message,
|
||||||
stack: error.stack,
|
stack: error.stack,
|
||||||
code: error.code,
|
code: error.code,
|
||||||
status: error.status
|
status: error.status
|
||||||
},
|
},
|
||||||
'Failed to reply to Discord interaction'
|
'Failed to reply to Discord interaction'
|
||||||
)
|
)
|
||||||
|
|
||||||
throw error
|
throw error
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user