From 7669f03cdcbb62a847e7d4917673be52ad2f7e79 Mon Sep 17 00:00:00 2001 From: Stephen Jefferson Date: Tue, 14 May 2024 18:04:49 +0100 Subject: [PATCH] Adjust log.exc to log.exception (#59) Logging module dropped support for exc. These adjustments use the exception method instead. --- tinyweb/server.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tinyweb/server.py b/tinyweb/server.py index cb48f85..bf3acba 100644 --- a/tinyweb/server.py +++ b/tinyweb/server.py @@ -476,16 +476,16 @@ async def _handler(self, reader, writer): try: await resp.error(500) except Exception as e: - log.exc(e, "") + log.exception(f"Failed to send 500 error after OSError. Original error: {e}") except HTTPException as e: try: await resp.error(e.code) except Exception as e: - log.exc(e) + log.exception(f"Failed to send error after HTTPException. Original error: {e}") except Exception as e: # Unhandled expection in user's method log.error(req.path.decode()) - log.exc(e, "") + log.exception(f"Unhandled exception in user's method. Original error: {e}") try: await resp.error(500) # Send exception info if desired