Skip to content

Commit

Permalink
Improve error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
farrokhi committed Jun 18, 2024
1 parent 8b46b30 commit e57eeb7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion util/dns.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,9 +134,11 @@ def ping(qname, server, dst_port, rdtype, timeout, count, proto, src_ip, use_edn
break
except dns.exception.Timeout:
break
except OSError:
except OSError as e:
if socket_ttl: # this is an acceptable error while doing traceroute
break
print("error: %s"% e.strerror, file=sys.stderr, flush=True)
raise OSError(e)
except Exception as e:
print("error: %s"% e, file=sys.stderr, flush=True)
break
Expand Down

0 comments on commit e57eeb7

Please sign in to comment.