Skip to content

Commit

Permalink
Handle connection reset error (#1645)
Browse files Browse the repository at this point in the history
  • Loading branch information
davfsa authored Jul 2, 2023
1 parent fc44ff0 commit 860cfcb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions changes/1645.bugfix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Handle connection reset error on shards.
3 changes: 3 additions & 0 deletions hikari/impl/shard.py
Original file line number Diff line number Diff line change
Expand Up @@ -886,6 +886,9 @@ async def _keep_alive(self) -> None:
# Since nothing went wrong, we can reset the backoff and try again
backoff.reset()

except ConnectionResetError:
self._logger.warning("connection got reset by server. Will retry shortly")

except errors.GatewayConnectionError as ex:
self._logger.warning("failed to communicate with server, reason was: %r. Will retry shortly", ex.reason)

Expand Down

0 comments on commit 860cfcb

Please sign in to comment.