Skip to content

Commit

Permalink
support inner http proxy error to be non-src
Browse files Browse the repository at this point in the history
  • Loading branch information
GlenDC committed Nov 8, 2024
1 parent 35d0084 commit 6c5c767
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,16 @@ impl std::error::Error for HttpProxyError {
match self {
HttpProxyError::AuthRequired => None,
HttpProxyError::Unavailable => None,
HttpProxyError::Transport(err) => err.source().and_then(|err| {
HttpProxyError::Transport(err) => {
// filter out generic io errors,
// but do allow custom errors (e.g. because IP is blocked)
if err.is::<std::io::Error>() {
let err_ref = err.source().unwrap_or_else(|| err.as_ref());
if err_ref.is::<std::io::Error>() {
None
} else {
Some(err)
Some(err_ref)
}
}),
}
HttpProxyError::Other(_) => None,
}
}
Expand Down

0 comments on commit 6c5c767

Please sign in to comment.