diff options
author | Guy Harris <gharris@sonic.net> | 2020-06-20 20:20:14 -0700 |
---|---|---|
committer | Guy Harris <gharris@sonic.net> | 2020-06-21 03:54:55 +0000 |
commit | 9e1fbfb766a81eea6cecb05f28bbb92da3a95bb2 (patch) | |
tree | 91b7d3f62858e4bc5f72f9f504659993129f12c7 /tools | |
parent | 78a507b142d1f10b54a379b1ceb837b9db687618 (diff) |
generate-sysdig-event.py: improve error reporting.
Catch particular exceptions and print a more detailed error.
Change-Id: Ied98c6d0bc0410eb8b9cb2a98f7264e980c2bb28
Reviewed-on: https://code.wireshark.org/review/37529
Petri-Dish: Guy Harris <gharris@sonic.net>
Tested-by: Petri Dish Buildbot
Reviewed-by: Guy Harris <gharris@sonic.net>
Diffstat (limited to 'tools')
-rwxr-xr-x | tools/generate-sysdig-event.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/tools/generate-sysdig-event.py b/tools/generate-sysdig-event.py index 5d18787699..66cafb4d51 100755 --- a/tools/generate-sysdig-event.py +++ b/tools/generate-sysdig-event.py @@ -41,8 +41,14 @@ def get_url_lines(url): response = urllib.request.urlopen(req) lines = response.read().decode().splitlines() response.close() + except urllib.error.HTTPError as err: + print("HTTP error fetching {0}: {1}".format(url, err.reason)) + except urllib.error.URLError as err: + print("URL error fetching {0}: {1}".format(url, err.reason)) + except OSError as err: + print("OS error fetching {0}".format(url, err.strerror)) except: - exit_msg('Error opening ' + url) + print("Unexpected error:", sys.exc_info()[0]) return lines |