-
Notifications
You must be signed in to change notification settings - Fork 45
Add error emitter #90
Comments
Hi ! Yes it could be great to add an error listener, but I rather think you can handle your code, for now, with
Errors aren't just logged insofar as they can crash an app, with a Thanks. |
I already tried try and catch and won't work, the code is using process.exit(). I forked, if I have some progress i'll make a pull request. Thanks! |
I was going to work on throwing errors or using callbacks, depending on if a callback is being used or not in version 4.0 but if you could contribute your code as well that'd be great 👍 |
Yes, I don't have so much time to work on it, but I'll try. |
I've made it so it returns the error in async mode in a callback and throws an error in sync mode in the latest version. Would you still like me to add the option to emit errors instead as an option? |
So does that mean, we can listen for error when the bot fails because plugdj is in maintenance mode, and responde accordingly without the node app crashing? :O That'd save my life. |
Plug does send a message to everyone ( a system message) for when maintenance is about to begin, i can add in that in the next release and you can listen to it and handle it your own way... ex
Not currently Implemented but will be soonish. Currently what is implemented is better error handling for Sync and offloading most errors for async to the developer of the bot.. |
The maintenance example you showed seems cool. I'm gonna have a look around the error thing, cuz I'm done dealing with unlistened errors. |
@johnRivs I've added a warning when plug alerts there will be a maintenance mode soon and the example code i gave should work (its actually MAINT_MODE though) in the latest version 👍 |
Add error emitters to manually handle.
ex: bot.on('error', function(err){});
Especially if fails to connect, throw a error on connection fail.
Only log to app error logger is not flexible.
The text was updated successfully, but these errors were encountered: