Skip to content

fix: Catch exception during TV shutdown#1

Closed
thecode wants to merge 1 commit intochros73:developfrom
thecode:fix-ws-close-exception
Closed

fix: Catch exception during TV shutdown#1
thecode wants to merge 1 commit intochros73:developfrom
thecode:fix-ws-close-exception

Conversation

@thecode
Copy link
Copy Markdown
Contributor

@thecode thecode commented Dec 16, 2021

The following exception happens when the TV is turned off and the Quick Start+ feature is disabled:

Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/aiopylgtv/webos_client.py", line 340, in ping_handler
    ping_waiter = await ws.ping()
  File "/usr/local/lib/python3.9/site-packages/websockets/legacy/protocol.py", line 657, in ping
    await self.ensure_open()
  File "/usr/local/lib/python3.9/site-packages/websockets/legacy/protocol.py", line 735, in ensure_open
    raise self.connection_closed_exc()
websockets.exceptions.ConnectionClosedOK: code = 1001 (going away), reason = server shutting down

This PR adds this exception to the silent exceptions since it is a normal behavior of the TV and should not raise an exception.

Catch exception raised when Quick Start+ is disabled and the TV is turned off due to server closing the connection.
@chros73
Copy link
Copy Markdown
Owner

chros73 commented Dec 17, 2021

Thanks, I had to add to one more place, so I close this PR and add it manually.

@chros73 chros73 closed this Dec 17, 2021
@thecode thecode deleted the fix-ws-close-exception branch December 17, 2021 08:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants