Skip to content

Commit ed125dc

Browse files
Resolve "Websocket reconnect should be mentioned in the logged warning"
1 parent 9ec0c88 commit ed125dc

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

src/kraken/spot/websocket/connectors.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -245,16 +245,20 @@ async def __reconnect(self: ConnectSpotWebsocketBase) -> None:
245245
if task.exception():
246246
self.state = WSState.ERRORHANDLING
247247
exception_occur = True
248-
message = f"{task} got an exception {task.exception()}\n {task.get_stack()}"
249-
LOG.warning(message)
248+
LOG.warning(
249+
"%s got an exception %s:\n%s\n"
250+
"The connection will be recovered in the background.",
251+
task,
252+
task.exception(),
253+
task.get_stack(),
254+
)
250255
for process in pending:
251256
LOG.warning("pending %s", process)
252257
try:
253258
process.cancel()
254259
LOG.warning("Cancelled %s", process)
255260
except asyncio.CancelledError:
256261
LOG.error("Failed to cancel %s", process)
257-
await self.__callback({"python-kraken-sdk": {"error": message}})
258262
if exception_occur:
259263
break
260264
self.state = WSState.CLOSED

0 commit comments

Comments
 (0)