We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
yew::services::websocket::WebSocketService::connect this function has an unwrap
let ws = WebSocket::new(url).unwrap();
for a malformed URL, this will result in a panic.
pub fn connect<OUT: 'static>( &mut self, url: &str, callback: Callback<OUT>, notification: Callback<WebSocketStatus>, ) -> Result<WebSocketTask> where OUT: From<Text> + From<Binary>, { let ws = WebSocket::new(url); if ws.is_err() { return Err("Failed to create WebSocket from given URL"); } ...
pub fn connect<OUT: 'static>( &mut self, url: &str, callback: Callback<OUT>, notification: Callback<WebSocketStatus>, ) -> WebSocketTask where OUT: From<Text> + From<Binary>, { let ws = WebSocket::new(url).unwrap();
when panic happen, there is no proper way to handle it, the best solution is to have an Err returned.
cargo-web: v 0.6.26
browser if relevant
The text was updated successfully, but these errors were encountered:
Thanks for the report, I agree we should go with your solution! I can get a fix together this weekend, if you need it sooner, feel free to send a PR
Sorry, something went wrong.
#727
With the associated PR merged, this can be closed now.
No branches or pull requests
Description
yew::services::websocket::WebSocketService::connect
this function has an unwrap
for a malformed URL, this will result in a panic.
Expected Results
Actual Results
when panic happen, there is no proper way to handle it, the best solution is to have an Err returned.
Context (Environment)
cargo-web: v 0.6.26
browser if relevant
The text was updated successfully, but these errors were encountered: