I am trying to get a Rust WebSocket server up and running. I started with the example code for an async websocker server.
Every time I get an Io
error, like when the connection is interrupted, the entire program ends without any error. I modified the code on line 26 of the example to:
.map_err(|InvalidConnection {error, ..}| {
println!("Error:{:?}",error);
return error;
})
This prints the error, but does not prevent the program from stopping only the single connection and not crashing itself.
The most common error I get is:
Io(Error { repr: Custom(Custom { kind: Other, error: Stream(Error { repr: Custom(Custom { kind: ConnectionAborted, error: StringError("unexpected EOF observed") }) }) }) })
Ok, with some help from rust IRC channel i found the solution. I've just replaced the error with None and filtered it out.
Maybe this info will help someone with similar problem.