Skip to content

Commit

Permalink
consolidate proxy connect errors
Browse files Browse the repository at this point in the history
  • Loading branch information
jrobsonchase committed Aug 22, 2023
1 parent abdf813 commit 3aa069b
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions ngrok/src/session.rs
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ fn connect_http_proxy(url: Uri) -> impl Connector {
let connector = HttpConnector::new();
async move {
let mut connector = ProxyConnector::from_proxy(connector, proxy)
.map_err(|e| ConnectError::ProxyUnsupportedError(format!("{e}")))?;
.map_err(|e| ConnectError::ProxyConnect(Box::new(e)))?;

let server_uri = format!("http://{host}:{port}").parse().unwrap();

Expand Down Expand Up @@ -339,10 +339,7 @@ pub enum ConnectError {
/// An error occurred when rebinding tunnels during a reconnect
#[error("error rebinding tunnel after reconnect")]
Rebind(#[source] RpcError),
/// An error arising from a misconfigured proxy
#[error("unsupported proxy address: {0}")]
ProxyUnsupportedError(String),
/// An error arising from a misconfigured proxy
/// An error arising from a failure to connect through a proxy.
#[error("failed to connect through proxy")]
ProxyConnect(#[source] Box<dyn std::error::Error + Send + Sync + 'static>),
/// The (re)connect function gave up.
Expand Down

0 comments on commit 3aa069b

Please sign in to comment.