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

Did you find this page helpful?