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
Nullified
Nullified•14mo ago
Are they uncaught exceptions, that might cause the program to exit. Automatically restarting is probably something you implemented yourself.
tyaa chrisella
tyaa chrisellaOP•14mo ago
hmm, that need process on uncaughtException? If so, I guess I forgot to put it
Nullified
Nullified•14mo ago
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.
tyaa chrisella
tyaa chrisellaOP•14mo ago
ahh i see, thanks for helping I'll try it first <:NGS_SadOkeyy:824099102157570058>
Nullified
Nullified•14mo ago
Good luck, make sure to handle potential errors well so you don't get unexpected exits like this 😛
Want results from more Discord servers?
Add your server