Skip to content

Is it possible to catch "Handshake status 404 Not Found - goodbye" exceptions? #113

@wmmihaa

Description

@wmmihaa

Describe the bug
Sometimes, when we have poor connections we get a websocket exception like this:

2024-11-10 14:37:49,942: Handshake status 404 Not Found - goodbye
2024-11-10 14:37:49,976: Traceback (most recent call last):
  File "/usr/lib/python3.9/site-packages/websocket/_app.py", line 371, in setSock
    self.sock.connect(
  File "/usr/lib/python3.9/site-packages/websocket/_core.py", line 253, in connect
    self.handshake_response = handshake(self.sock, url, *addrs, **options)
  File "/usr/lib/python3.9/site-packages/websocket/_handshake.py", line 57, in handshake
    status, resp = _get_resp_headers(sock)
  File "/usr/lib/python3.9/site-packages/websocket/_handshake.py", line 147, in _get_resp_headers
    raise WebSocketBadStatusException("Handshake status %d %s", status, status_message, resp_headers)
websocket._exceptions.WebSocketBadStatusException: Handshake status 404 Not Found

2024-11-10 14:37:49,982: <signalrcore.transport.websockets.websocket_transport.WebsocketTransport object at 0xb52d38b0> Handshake status 404 Not Found
2024-11-10 14:37:49,989: Handshake status 404 Not Found <class 'websocket._exceptions.WebSocketBadStatusException'>

Is it possible to catch this exception so that we can manage retries?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions