Skip to content

Commit

Permalink
return instead of ignore error (#1287)
Browse files Browse the repository at this point in the history
* return error instead of swallow error

* changelog

Co-authored-by: Bryan Stitt <bryan@satoshiandkin.com>
  • Loading branch information
BlinkyStitt and Bryan Stitt committed May 23, 2022
1 parent fe4de84 commit 9ed9395
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@
- Add `TransactionReceipt::to` and `TransactionReceipt::from`
[#1184](https://github.com/gakonst/ethers-rs/pull/1184)
- Add `From<H160>` and From<Vec<H160>> traits to `ValueOrArray<H160>` [#1199](https://github.com/gakonst/ethers-rs/pull/1200)
- Fix handling of Websocket connection errors [#1287](https://github.com/gakonst/ethers-rs/pull/1287)

## ethers-contract-abigen

Expand Down
5 changes: 3 additions & 2 deletions ethers-providers/src/transports/ws.rs
Original file line number Diff line number Diff line change
Expand Up @@ -401,8 +401,9 @@ where
// Handle ws messages
resp = self.ws.next() => match resp {
Some(Ok(resp)) => self.handle(resp).await?,
// TODO: Log the error?
Some(Err(_)) => {},
Some(Err(_)) => {
return Err(ClientError::UnexpectedClose);
}
None => {
return Err(ClientError::UnexpectedClose);
},
Expand Down

0 comments on commit 9ed9395

Please sign in to comment.