Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error handling in websocket_handler swallows RPCErrors #12

Open
phijor opened this issue Jun 15, 2021 · 0 comments
Open

Error handling in websocket_handler swallows RPCErrors #12

phijor opened this issue Jun 15, 2021 · 0 comments
Labels
bug Something isn't working

Comments

@phijor
Copy link
Contributor

phijor commented Jun 15, 2021

The code here...

try:
msg_data = json.loads(msg.data)
if msg_data["function"] == "subscribe":
new_metrics = set(msg_data["metrics"])
metadata = await sink.subscribe_ws(ws, new_metrics - metrics)
await ws.send_metadata(metadata)
metrics |= new_metrics
except Exception as e:
logger.error(
"error during message handling {}: {}\n{}",
type(e),
e,
traceback.format_exc(),
)
break

...breaks out of the websocket message loop, but does not result in app termination. Exceptions of type RPCError should most likely be fatal.

@phijor phijor added the bug Something isn't working label Jun 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant