Force restarted after getting discord.js error
Hi, i want to ask about my bot, if i get some error from sapphire like error from "args", that not make my bot restarted, but if i get some error from discord.js like "Unknown Message" or nothing else the bot force restarted, can you help me pliss? <a:NGS_PleadCry:958030314943434752>
5 Replies
Are they uncaught exceptions, that might cause the program to exit. Automatically restarting is probably something you implemented yourself.
hmm, that need process on uncaughtException?
If so, I guess I forgot to put it
Well the best way to do this would be to actually catch the exception using try/catch or .catch().
In the case of a promise rejection, anyways.
ahh i see, thanks for helping
I'll try it first
<:NGS_SadOkeyy:824099102157570058>
Good luck, make sure to handle potential errors well so you don't get unexpected exits like this 😛