Xuanwo commented on code in PR #4735:
URL: https://github.com/apache/opendal/pull/4735#discussion_r1639561324


##########
core/src/services/s3/writer.rs:
##########
@@ -158,7 +158,16 @@ impl oio::MultipartWrite for S3Writer {
         let status = resp.status();
 
         match status {
-            StatusCode::OK => Ok(()),
+            StatusCode::OK => {
+                let (_, mut body) = resp.into_parts();
+                let bs = body.copy_to_bytes(body.remaining());

Review Comment:
   `Buffer` itself implements `bytes::Buf` so we don't need to copy to bytes 
first.



##########
core/src/services/s3/writer.rs:
##########
@@ -158,7 +158,16 @@ impl oio::MultipartWrite for S3Writer {
         let status = resp.status();
 
         match status {
-            StatusCode::OK => Ok(()),
+            StatusCode::OK => {
+                let (_, mut body) = resp.into_parts();
+                let bs = body.copy_to_bytes(body.remaining());
+                let result: CompleteMultipartUploadResult =

Review Comment:
   Maybe we can use `parse_error` while the returning response contains 
`<Error>`? Using `Error::new(ErrorKind::Unexpected, &result.message)` here is 
incorrect since we have our `temporary` and `context` to set.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to