Best way to handle ready event failure
Recently my bot had a lot of downtime because it auto-restarted but never got properly readied; it seems it silently errored with a
RequestAbortedError
.
What's the best way to handle something happening like that? When it errored it never fired the ready event and put the bot into a do-nothing limbo until I manually restarted it. Is there an event I should listen to, or just a generic timeout I should set to see if it readied properly?6 Replies
- What's your exact discord.js
npm list discord.js
and node node -v
version?
- Not a discord.js issue? Check out #other-js-ts.
- Consider reading #how-to-get-help to improve your question!
- Explain what exactly your issue is.
- Post the full error stack trace, not just the top part!
- Show your code!
- Issue solved? Press the button!sounds like a network issue, might wanna look into that
i did, it was because of Discord earlier
but i want to make sure it doesn't get stuck again by just giving up getting ready
well i just call client.login() and it shouldn't catch any errors, but in this particular situation i got an error in my logs but it did not stop the process, which caused it just to sit and do nothing
ideally it should error and restart itself (through pm2), i don't know why it did not
how would i go about fixing that? i'm not sure why it'd log but not fail
just pm2's default process error log
or with
missed these messages; yea that should definitely help. thank you!