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

Panic when client connects to host which is not listenning #4

Open
elast0ny opened this issue Dec 26, 2019 · 0 comments
Open

Panic when client connects to host which is not listenning #4

elast0ny opened this issue Dec 26, 2019 · 0 comments

Comments

@elast0ny
Copy link

The call to connect() ends up calling unwrap() which makes the program panic.

Client code :

let mut client = match connection.connect() {
        Ok(c) => c,
        Err(e) => {
            return Err(ProjectError::ConnectionFailed(format!("{}",e)))
        },
    };

Log output

[2019-12-26T20:05:13Z ERROR ws::handler] WS Error <Io(Os { code: 10061, kind: ConnectionRefused, message: "No connection could be made because the target machine actively refused it." })>
[2019-12-26T20:05:13Z TRACE ws::io] WebSocket connection to token=Token(0) disconnected.
[2019-12-26T20:05:13Z TRACE ws::io] Active connections 0
[2019-12-26T20:05:13Z DEBUG ws::io] Shutting down websocket client.
[2019-12-26T20:05:13Z DEBUG ws::factory] Factory received WebSocket shutdown request.
[2019-12-26T20:05:13Z TRACE mio::poll] deregistering handle with poller
[2019-12-26T20:05:13Z TRACE mio::poll] deregistering handle with poller
[2019-12-26T20:05:13Z TRACE mio::poll] deregistering handle with poller
[2019-12-26T20:05:13Z DEBUG wampire::client] Result of connection: Ok(())
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: RecvError', src\libcore\result.rs:1165:5
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
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

No branches or pull requests

1 participant