|
@@ -743,6 +743,11 @@ mod tests {
|
|
|
|
|
|
if let Error::ReqwestError(e) = e {
|
|
|
// expected
|
|
|
+ assert!(e.is_connect(), "Connect error");
|
|
|
+ // e.to_string() doesn't have all of the inner errors.
|
|
|
+ let message = format!("{:?}", e);
|
|
|
+ assert!(message.contains("ConnectionRefused"), "Connection refused");
|
|
|
+ assert!(message.contains("tcp connect error"), "TCP Connect error");
|
|
|
// println!("Yes, reqwest::Error: {:?}", e);
|
|
|
} else {
|
|
|
panic!("Not the error type we were expecting: {:?}", e);
|