Skip to content
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

Merged
merged 3 commits into from
Nov 28, 2018
Merged

Conversation

Sorunome
Copy link
Collaborator

to remove unhandled promise rejections, solving #296

src/bot.ts Outdated
client.on("typingStart", async (c, u) => {
try {
await this.OnTyping(c, u, true);
} catch (err) { log.error("typingStart", err); }
Copy link
Contributor

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); }
Copy link
Contributor

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"

Copy link
Contributor

@Half-Shot Half-Shot left a 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.

@Half-Shot Half-Shot merged commit 967b138 into develop Nov 28, 2018
@Sorunome Sorunome deleted the soru/unhandled-promise-rejection branch January 22, 2019 10:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants