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

Catch errors thrown by pcap #23

Merged
merged 2 commits into from
Jan 19, 2016
Merged

Conversation

ecaron
Copy link
Contributor

@ecaron ecaron commented Jan 18, 2016

2% of this change is just adding a try/catch inside of pcap_session.on('packet')
The rest is adjusting the mock-test suite to permit testing of this change (primarily to isolate the "should throw an error if no interfaces are available" mechanism from having negative impacts on other tests further down the line)

Since pcap throws errors in a variety of decoding operations*,
we catch them when we're doing the packet decoding and then just
proceed like normal.

* See https://github.com/mranney/node_pcap/search?utf8=%E2%9C%93&q=%22throw+new%22
…erfaces are available"

from impacting tests further down the line.
hortinstein added a commit that referenced this pull request Jan 19, 2016
Catch errors thrown by pcap
@hortinstein hortinstein merged commit 53092e0 into hortinstein:master Jan 19, 2016
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.

None yet

2 participants