Skip to content

Commit

Permalink
mqtt.protocol.handler: Use exc_info to emit exception not %s
Browse files Browse the repository at this point in the history
The former emits the stack trace, which greatly helps in identifying
_WHERE_ an exception is raised, not just WHAT the exception is.
  • Loading branch information
sjlongland committed Jun 10, 2023
1 parent 22132bc commit 65cb7cf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions amqtt/mqtt/protocol/handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -530,8 +530,8 @@ async def _send_packet(self, packet):
await self.handle_connection_closed()
except asyncio.CancelledError:
raise
except Exception as e:
self.logger.warning("Unhandled exception: %s" % e)
except:
self.logger.warning("Unhandled exception", exc_info=True)
raise

async def mqtt_deliver_next_message(self):
Expand Down

0 comments on commit 65cb7cf

Please sign in to comment.