-
Notifications
You must be signed in to change notification settings - Fork 151
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add try...catch everywhere #313
Conversation
src/bot.ts
Outdated
client.on("typingStart", async (c, u) => { | ||
try { | ||
await this.OnTyping(c, u, true); | ||
} catch (err) { log.error("typingStart", err); } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some of these could be warnings, because someone on error logging probably doesn't care if the odd typing notif fails.
src/bot.ts
Outdated
client.on("typingStop", async (c, u) => { | ||
try { | ||
await this.OnTyping(c, u, false); | ||
} catch (err) { log.error("typingStop", err); } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These errors could stand to be a little more descriptive like "Exception thrown while handling "typingStop" event"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks sensible, just needs a bit more thought in the logging.
to remove unhandled promise rejections, solving #296