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