aboutsummaryrefslogtreecommitdiffhomepage
path: root/pingora-proxy/src/lib.rs
diff options
context:
space:
mode:
authorYuchen Wu <[email protected]>2024-06-27 13:42:42 -0700
committerYuchen Wu <[email protected]>2024-07-12 11:24:29 -0700
commitcdefa5c431b907ce1030066172d49744856c1189 (patch)
tree5d422b99f30da30ec9feef43e250efcc17ed8b72 /pingora-proxy/src/lib.rs
parent65b1d6c733babb74df1b4bdf6a0c5e5c8e1b7a6a (diff)
downloadpingora-cdefa5c431b907ce1030066172d49744856c1189.tar.gz
pingora-cdefa5c431b907ce1030066172d49744856c1189.zip
Mark the error source from get_http_session()
Although it is implied that fail_to_connect() errors are already caused by upstream connections, it is more clear for the user's code inside this callback by marking the error source in this case.
Diffstat (limited to 'pingora-proxy/src/lib.rs')
-rw-r--r--pingora-proxy/src/lib.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/pingora-proxy/src/lib.rs b/pingora-proxy/src/lib.rs
index 99e7d6d..a02b23f 100644
--- a/pingora-proxy/src/lib.rs
+++ b/pingora-proxy/src/lib.rs
@@ -230,7 +230,8 @@ impl<SV> HttpProxy<SV> {
}),
)
}
- Err(e) => {
+ Err(mut e) => {
+ e.as_up();
let new_err = self.inner.fail_to_connect(session, &peer, ctx, e);
(false, Some(new_err.into_up()))
}