Skip to content

Commit

Permalink
Adjust log.exc to log.exception (#59)
Browse files Browse the repository at this point in the history
Logging module dropped support for exc. These adjustments use the exception method instead.
  • Loading branch information
sjefferson99 authored May 14, 2024
1 parent b4393ac commit 7669f03
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tinyweb/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 7669f03

Please sign in to comment.