From 34ee51bf8487e889e910f15a0c2ecf9b4503193f Mon Sep 17 00:00:00 2001 From: John Donaldson Date: Wed, 12 Jun 2019 18:59:33 +0100 Subject: [PATCH 1/2] Add better logging for raised exceptions --- devel/devel-server.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/devel/devel-server.py b/devel/devel-server.py index f81c0cc..3bc2e29 100755 --- a/devel/devel-server.py +++ b/devel/devel-server.py @@ -150,7 +150,8 @@ class MothRequestHandler(http.server.SimpleHTTPRequestHandler): try: catdir = self.server.args["puzzles_dir"].joinpath(category) mb = mothballer.package(category, catdir, self.seed) - except: + except Exception as ex: + logger.exception(ex) self.send_response(200) self.send_header("Content-Type", "text/html; charset=\"utf-8\"") self.end_headers() From c73abb0c61d4704fefe5738cddddb23e3c6aa895 Mon Sep 17 00:00:00 2001 From: John Donaldson Date: Wed, 12 Jun 2019 19:20:30 +0100 Subject: [PATCH 2/2] And, of course, I spelled it wrong . . . --- devel/devel-server.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/devel/devel-server.py b/devel/devel-server.py index 3bc2e29..7f35e33 100755 --- a/devel/devel-server.py +++ b/devel/devel-server.py @@ -151,7 +151,7 @@ class MothRequestHandler(http.server.SimpleHTTPRequestHandler): catdir = self.server.args["puzzles_dir"].joinpath(category) mb = mothballer.package(category, catdir, self.seed) except Exception as ex: - logger.exception(ex) + logging.exception(ex) self.send_response(200) self.send_header("Content-Type", "text/html; charset=\"utf-8\"") self.end_headers()