Skip to content

Commit

Permalink
tweak(bot): treat missing login error message
Browse files Browse the repository at this point in the history
  • Loading branch information
tabarra committed Sep 10, 2023
1 parent 98dd0bb commit 8af2906
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion core/components/DiscordBot/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,11 @@ export default class DiscordBot {
//Start bot
this.#client.login(this.config.token).catch((error) => {
clearInterval(disallowedIntentsWatcherId);
console.error(`Discord login failed with error: ${(error as Error).message}`);
//if no message, create one
if (!('message' in error) || !error.message){
error.message = 'no reason available - ' + JSON.stringify(error);
}
console.error(`Discord login failed with error: ${error.message}`);
return reject(error);
});
});
Expand Down

0 comments on commit 8af2906

Please sign in to comment.