Suppress frontend websocket error #8431
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR suppresses the often-seen error 104 "Connection reset by peer" for the frontend UI websocket by overriding the
unhandled_error
function from ws4py.Several other projects on Github using websockets have done the same thing (example: https://github.com/canonical/pylxd/blob/9e73391db1437f88fc00d36c1b023c9eaf0d35ea/pylxd/models/instance.py#L759)
This error could also be suppressed in output.py for the birdseye websocket, but it might be best not to commit this there yet until the other output issues are mitigated.