Skip to content

Commit

Permalink
feat(services/s3): Implement Multipart support (#571)
Browse files Browse the repository at this point in the history
Signed-off-by: Xuanwo <github@xuanwo.io>

Signed-off-by: Xuanwo <github@xuanwo.io>
  • Loading branch information
Xuanwo committed Aug 25, 2022
1 parent ce5e6b8 commit fddc542
Show file tree
Hide file tree
Showing 5 changed files with 378 additions and 16 deletions.
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -107,3 +107,4 @@ size = "0.4"
tokio = { version = "1.20", features = ["fs", "macros", "rt-multi-thread"] }
uuid = { version = "1.0", features = ["serde", "v4"] }
wiremock = "0.5"
pretty_assertions = "1"
12 changes: 8 additions & 4 deletions src/http_util/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ use crate::error::other;
use crate::error::ObjectError;

/// Create error happened during building http request.
pub fn new_request_build_error(op: &'static str, path: &str, err: http::Error) -> Error {
pub fn new_request_build_error(op: impl Into<&'static str>, path: &str, err: http::Error) -> Error {
other(ObjectError::new(
op,
path,
Expand All @@ -44,7 +44,11 @@ pub fn new_request_build_error(op: &'static str, path: &str, err: http::Error) -
}

/// Create error happened during signing http request.
pub fn new_request_sign_error(op: &'static str, path: &str, err: anyhow::Error) -> Error {
pub fn new_request_sign_error(
op: impl Into<&'static str>,
path: &str,
err: anyhow::Error,
) -> Error {
other(ObjectError::new(
op,
path,
Expand All @@ -53,7 +57,7 @@ pub fn new_request_sign_error(op: &'static str, path: &str, err: anyhow::Error)
}

/// Create error happened during sending http request.
pub fn new_request_send_error(op: &'static str, path: &str, err: isahc::Error) -> Error {
pub fn new_request_send_error(op: impl Into<&'static str>, path: &str, err: isahc::Error) -> Error {
let kind = match err.kind() {
// The HTTP client failed to initialize.
//
Expand Down Expand Up @@ -96,7 +100,7 @@ pub fn new_request_send_error(op: &'static str, path: &str, err: isahc::Error) -
}

/// Create error happened during consuming http response.
pub fn new_response_consume_error(op: &'static str, path: &str, err: Error) -> Error {
pub fn new_response_consume_error(op: impl Into<&'static str>, path: &str, err: Error) -> Error {
Error::new(
err.kind(),
ObjectError::new(op, path, anyhow!("consuming response: {err:?}")),
Expand Down
Loading

1 comment on commit fddc542

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deploy preview for opendal ready!

✅ Preview
https://opendal-bn5ya984l-databend.vercel.app

Built with commit fddc542.
This pull request is being automatically deployed with vercel-action

Please sign in to comment.