diff options
author | nico <nico@magicbroccoli.de> | 2020-08-06 13:26:04 +0200 |
---|---|---|
committer | nico <nico@magicbroccoli.de> | 2020-08-06 13:26:04 +0200 |
commit | bf49087072dcda8841b4a1084767c4fc1b0da68e (patch) | |
tree | 5d06c113be17135aed1dff385e0ba791c21c2db2 /prometheus.py | |
parent | 091b6e525aacad1abf8d800338d242141dec11c2 (diff) | |
parent | 0befdb44c27075c991515bbe50f53454fc5bc183 (diff) |
Merge branch 'exception' into 'master'
Bare exception handling
Closes #4 and #5
See merge request sum7/ejabberd-tools!7
Diffstat (limited to 'prometheus.py')
-rwxr-xr-x | prometheus.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/prometheus.py b/prometheus.py index a526851..676b6fc 100755 --- a/prometheus.py +++ b/prometheus.py @@ -23,8 +23,8 @@ class DynamicMetricsHandler(BaseHTTPRequestHandler): registry = registry.restricted_registry(params["name[]"]) try: output = generate_latest(registry) - except: # noqa: E722 - self.send_error(500, "error generating metric output") + except Exception as exception: + self.send_error(500, f"error generating metric output: {exception}") raise self.send_response(200) self.send_header("Content-Type", CONTENT_TYPE_LATEST) |