Skip to content

Commit

Permalink
Catch more exceptions
Browse files Browse the repository at this point in the history
  • Loading branch information
LeStegii authored and insomniacslk committed Aug 28, 2024
1 parent 00ca6f6 commit 05a3042
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions dublintraceroute/py3/_dublintraceroute.cc
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,12 @@ static PyObject* DublinTraceroute_traceroute(PyObject *self, PyObject *args)
std::shared_ptr<TracerouteResults> results;
try {
results = dublintraceroute->traceroute();
} catch (Tins::malformed_packet &e) {
PyErr_SetString(PyExc_RuntimeError, e.what());
return NULL;
} catch (std::runtime_error &e) {
PyErr_SetString(PyExc_RuntimeError, e.what());
return NULL;
} catch (DublinTracerouteException &e) {
PyErr_SetString(PyExc_RuntimeError, e.what());
return NULL;
Expand Down

0 comments on commit 05a3042

Please sign in to comment.