diff --git a/nonebot/drivers/fastapi.py b/nonebot/drivers/fastapi.py index b263ba7a..3fda94f4 100644 --- a/nonebot/drivers/fastapi.py +++ b/nonebot/drivers/fastapi.py @@ -440,6 +440,7 @@ class Driver(ReverseDriver, ForwardDriver): logger.opt(colors=True).error( "WebSocket connection closed by peer. " "Try to reconnect...") + break except Exception as e: logger.opt(colors=True, exception=e).error( f"Error while connecting to {url}. "