Xuanwo commented on code in PR #2171:
URL: 
https://github.com/apache/incubator-opendal/pull/2171#discussion_r1181395250


##########
core/src/services/s3/error.rs:
##########
@@ -58,16 +58,8 @@ pub async fn parse_error(resp: Response<IncomingAsyncBody>) 
-> Result<Error> {
         .map(|s3_err| (format!("{s3_err:?}"), Some(s3_err)))
         .unwrap_or_else(|_| (String::from_utf8_lossy(&bs).into_owned(), None));
 
-    // All possible error code: 
<https://docs.aws.amazon.com/AmazonS3/latest/API/ErrorResponses.html#ErrorCodeList>
     if let Some(s3_err) = s3_err {
-        (kind, retryable) = match s3_err.code.as_str() {
-            // > Your socket connection to the server was not read from
-            // > or written to within the timeout period."
-            //
-            // It's Ok for us to retry it again.
-            "RequestTimeout" => (ErrorKind::Unexpected, true),
-            _ => (kind, retryable),
-        }
+        (kind, retryable) = 
parse_s3_error_code(s3_err.code.as_str()).unwrap_or((kind, retryable));

Review Comment:
   I got it. We need to re-use the old `(ErrorKind, bool)` here. Let's merge 
first and polish the error handling logic later.



-- 
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