Skip to content

Commit

Permalink
Ignore more connection errors
Browse files Browse the repository at this point in the history
Simultaneous button spam on Who's That Pokémon minigame can cause ECONNRESET socket hang up error
  • Loading branch information
Glazelf committed May 15, 2024
1 parent eb24672 commit f23bdf2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions util/logger.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ module.exports = async (exception, client, interaction = null) => {
return sendMessage({ client: client, interaction: interaction, content: "An internal server error occurred at Discord. Please check back later to see if Discord has fixed the issue.", ephemeral: true });
} else if (exceptionString.includes("Unknown interaction")) {
return; // Expired interaction, can't reply to said interaction
} else if (exceptionString.includes("connect ETIMEDOUT") || exceptionString.includes("connect ECONNREFUSED")) {
return;
} else if (exceptionString.includes("ETIMEDOUT") || exceptionString.includes("ECONNREFUSED") || exceptionString.includes("ECONNRESET")) {
return; // Connection/network errors, not a bot issue for the most part. Might be Discord rate limits involved, especially with ECONNRESET socket hang up errors
} else if (exceptionString.includes("AxiosError")) {
return console.log(`${timestamp}: Axios error occurred (likely remote server connection or bad gateway)`);
} else if (!exceptionString.includes("Missing Permissions")) {
Expand Down

0 comments on commit f23bdf2

Please sign in to comment.