Skip to content

Commit

Permalink
ws_coin: better error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
WestXu committed May 7, 2024
1 parent 1517b38 commit b60ddc5
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions src/ws_coin/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ impl WsCoin {
break;
}
Err(error) => {
println!("{}", error);
println!("error happened during connection: {error}, retrying...");
}
}
}
Expand Down Expand Up @@ -145,12 +145,7 @@ impl WsCoin {
Ok(price) => yield price,
Err(error) => {
println!("{}\n\n\n\n\n\n\n\n", error);
match error {
RecvError::RecevingError(_) => {
self.reconnect().await;
}
RecvError::UnexpectedMsgError(_) | RecvError::ParsingError(_) => (),
}
self.reconnect().await
}
}
}
Expand Down

0 comments on commit b60ddc5

Please sign in to comment.