diff options
author | Yuchen Wu <[email protected]> | 2024-06-27 13:42:42 -0700 |
---|---|---|
committer | Yuchen Wu <[email protected]> | 2024-07-12 11:24:29 -0700 |
commit | cdefa5c431b907ce1030066172d49744856c1189 (patch) | |
tree | 5d422b99f30da30ec9feef43e250efcc17ed8b72 | |
parent | 65b1d6c733babb74df1b4bdf6a0c5e5c8e1b7a6a (diff) | |
download | pingora-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.
-rw-r--r-- | .bleep | 2 | ||||
-rw-r--r-- | pingora-proxy/src/lib.rs | 3 |
2 files changed, 3 insertions, 2 deletions
@@ -1 +1 @@ -00504ca4d524990b3a1b53bbeb42824c3fbdcfe9
\ No newline at end of file +d295eb585fee737413583b185f82fc2fd46f1d50
\ No newline at end of file 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())) } |