From 0befdb44c27075c991515bbe50f53454fc5bc183 Mon Sep 17 00:00:00 2001 From: genofire Date: Sun, 19 Jul 2020 22:34:11 +0200 Subject: exception handling --- prometheus.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'prometheus.py') 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) -- cgit v1.2.3-54-g00ecf