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

Handle C++ exceptions #22

Merged
merged 2 commits into from
Aug 28, 2024
Merged

Handle C++ exceptions #22

merged 2 commits into from
Aug 28, 2024

Conversation

LeStegii
Copy link
Contributor

@LeStegii LeStegii commented Aug 27, 2024

This PR catches more underlying C++ exceptions and handles them to prevent python from crashing when encountering one.

Currently, the following exceptions are caught:

  • std::runtime_error (e.g. when running without permissions)
  • Tins::malformed_packet

Fixes #21 and #10 (at least partially)

Copy link
Owner

@insomniacslk insomniacslk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thank you!

@insomniacslk
Copy link
Owner

The failures are due to Python 2 being too old, I'll disable the old code

@insomniacslk
Copy link
Owner

insomniacslk commented Aug 28, 2024

Done at #23 , please rebase the PR so the new tests will be picked up

@insomniacslk insomniacslk marked this pull request as ready for review August 28, 2024 07:11
@insomniacslk
Copy link
Owner

codecov failing because of the token, but this looks good to me

@insomniacslk insomniacslk merged commit 05a3042 into insomniacslk:master Aug 28, 2024
3 of 6 checks passed
@LeStegii
Copy link
Contributor Author

Alright 👍
Do you know any other possible exceptions so that #10 can be closed as well?

@insomniacslk
Copy link
Owner

insomniacslk commented Aug 29, 2024

yes - std::invalid_argument, and std::out_of_range, which are thrown directly by libdublintraceroute. I could also wrap std::runtime_error in DublinTracerouteException, but not the other ones, that are already more expressive

@insomniacslk
Copy link
Owner

@LeStegii I've created #24 for the purpose

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.

Malformed packet error ('Tins::malformed_packet')
2 participants