Skip to content

Commit

Permalink
Slightly more robust error checking
Browse files Browse the repository at this point in the history
  • Loading branch information
elliottt committed Sep 20, 2023
1 parent 93dc947 commit 27ef314
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ async fn run() {
)
.await;

let error = res.unwrap_err();
assert_eq!(error.to_string(), "Error::InvalidUrl(\"failed to lookup address information: Temporary failure in name resolution\")");
let error = res.unwrap_err().to_string();
assert!(error.starts_with("Error::InvalidUrl(\"failed to lookup address information:"));
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ async fn run() {

let error = res.unwrap_err().to_string();
if error.ne("Error::ProtocolError(\"invalid HTTP version parsed\")")
&& error.ne("Error::ProtocolError(\"operation was canceled\")")
&& !error.starts_with("Error::ProtocolError(\"operation was canceled")
{
panic!(
r#"assertion failed: `(left == right)`
Expand Down

0 comments on commit 27ef314

Please sign in to comment.