Skip to content

Commit

Permalink
Log track back in on_packet
Browse files Browse the repository at this point in the history
Many errors are raised in on_packet() callbacks, but currently it only
provides a very brief error message.
  • Loading branch information
zxzxwu committed Nov 28, 2023
1 parent a13e193 commit 847693a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions bumble/transport/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import asyncio
import logging
import io
import traceback
from typing import ContextManager, Tuple, Optional, Protocol, Dict

from bumble import hci
Expand Down Expand Up @@ -153,6 +154,7 @@ def feed_data(self, data: bytes) -> None:
logger.warning(
color(f'!!! Exception in on_packet: {error}', 'red')
)
logger.warning(traceback.format_exc())
self.reset()

def set_packet_sink(self, sink: TransportSink) -> None:
Expand Down

0 comments on commit 847693a

Please sign in to comment.