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

Error Handling Improvements (all errors should gracefully fail) #421

Closed
ghost opened this issue Oct 26, 2015 · 4 comments
Closed

Error Handling Improvements (all errors should gracefully fail) #421

ghost opened this issue Oct 26, 2015 · 4 comments

Comments

@ghost
Copy link

ghost commented Oct 26, 2015

I purpose to improve error handling to prevent crashing as much as programmatically possible during normal operations.

@moshmage
Copy link

In regards to #419, shouldn't a case: 'NICK' be fired?

On topic: Are we talking about just.. wrapping the whole thing into a try, catch and add checks on top of each case and finally throw them back?

@ghost
Copy link
Author

ghost commented Oct 27, 2015

Lines: 747-753:

747:            try {
                    self.emit('raw', message);
                } catch (err) {
                    if (!self.conn.requestedDisconnect) {
                        throw err;
                    }
753:           }

At a minimum what I'm thinking is we take these lines and instead of throwing an error after the hail mary, we send the error message to console, and make a threshold. If we see 3-5 errors in less then 5 seconds then we throw the err.

To your idea, maybe wrapping try catch to every case would be a good idea. It might help vet out other things, possibly a good excuse to crawl through the code again.

@moshmage
Copy link

I'd do a "lets first close all the PRs" motion before handling this refactor, but we are on the same page on this one :)

@ghost
Copy link
Author

ghost commented Oct 29, 2015

Fine by me.

@ghost ghost closed this as completed Oct 29, 2015
This issue was closed.
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

No branches or pull requests

1 participant