-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
fix(websocket): Fix PermissionDenied error being caught in constructor #8402
fix(websocket): Fix PermissionDenied error being caught in constructor #8402
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add a unit test that assures PermissionDenied
is thrown
I made a little test, @crowlKats is this sufficient to demo the problem? |
@ry thanks! yes it would. there shouldnt even really be any need for the eventhandler |
# Conflicts: # cli/tests/integration_tests.rs
@@ -0,0 +1 @@ | |||
warning: network access to "ws:https://localhost/", run again with the --allow-net flag |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a bit surprising, is there a reason why we can't catch this error? What happens if there's onerror
handler attached to the WebSocket? It'd be great to test that scenario as well
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The error will be passed to the error event as well
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is preferable solution to the problem instead of logging a warning to the console
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks @crowlKats
Fixes #8394