Skip to content

Uncaught LocalProtocolError (wsproto >= 1.2.0) #175

Closed
@notonamap

Description

@notonamap

Hey there, first of all many thanks for providing this great library!
I'm running version 0.9.2 but I think it might be still relevant.
Websocket server had some ongoing maintenance and was dropping connections from time to time. Looks like this lead to the issue seen below. Should this wsproto error maybe be mapped to ConnectionClosed?

File "/pex-app/lib/python3.10/site-packages/trio_websocket/_impl.py", line 937, in send_message
      await self._send(event)
    File "/pex-app/lib/python3.10/site-packages/trio_websocket/_impl.py", line 1249, in _send
      data = self._wsproto.send(event)
    File "/pex-app/lib/python3.10/site-packages/wsproto/__init__.py", line 64, in send
      data += self.connection.send(event)
    File "/pex-app/lib/python3.10/site-packages/wsproto/connection.py", line 107, in send
      raise LocalProtocolError(
  wsproto.utilities.LocalProtocolError: Event TextMessage(data='...', frame_finished=True, message_finished=True) cannot be sent in state ConnectionState.REMOTE_CLOSING.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions