This is an automated email from the ASF dual-hosted git repository.

alamb pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/arrow-rs-object-store.git


The following commit(s) were added to refs/heads/main by this push:
     new 18102f3  impl HttpError::new_boxed to provide user with ability to 
ctor from already boxed error (#789)
18102f3 is described below

commit 18102f35d2c81dfbc9aefbb5797c33b39f2641d5
Author: Douman <[email protected]>
AuthorDate: Thu Jul 9 09:08:24 2026 +0900

    impl HttpError::new_boxed to provide user with ability to ctor from already 
boxed error (#789)
---
 src/client/http/connection.rs | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/src/client/http/connection.rs b/src/client/http/connection.rs
index c7cd2c1..0558a7e 100644
--- a/src/client/http/connection.rs
+++ b/src/client/http/connection.rs
@@ -81,10 +81,13 @@ impl HttpError {
     where
         E: Error + Send + Sync + 'static,
     {
-        Self {
-            kind,
-            source: Box::new(e),
-        }
+        Self::new_boxed(kind, Box::new(e))
+    }
+
+    #[inline]
+    /// Create a new [`HttpError`] with provided `source` error
+    pub fn new_boxed(kind: HttpErrorKind, source: Box<dyn Error + Send + 
Sync>) -> Self {
+        Self { kind, source }
     }
 
     #[cfg(feature = "reqwest")]

Reply via email to