Skip to content

Commit

Permalink
Update sendMessageExceptionHandler timeout strings (#2067)
Browse files Browse the repository at this point in the history
* Update sendMessageExceptionHandler timeout strings

* Handle interaction alreayd handled
  • Loading branch information
Brainicism authored Apr 6, 2024
1 parent 05d05aa commit f569c06
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/helpers/discord_utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,11 @@ async function sendMessageExceptionHandler(
}
}
} else if (e instanceof Error) {
if (e.message.includes("Request timed out")) {
if (
["Request timed out", "connect ETIMEDOUT"].some((errString) =>
e.message.includes(errString),
)
) {
logger.warn(
`Error sending message. Request timed out. textChannelID = ${channelID}. Name: ${e.name}. Reason: ${e.message}. Stack: ${e.stack}`,
);
Expand Down Expand Up @@ -1840,6 +1844,13 @@ function interactionRejectionHandler(
)} | Interaction acknowledge (unknown interaction)`,
);
return;
} else if (err.code === 40060) {
logger.warn(
`${getDebugLogHeader(
interaction,
)} | Interaction already acknowledged`,
);
return;
}

logger.error(
Expand Down

0 comments on commit f569c06

Please sign in to comment.