You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@opendal.apache.org by xu...@apache.org on 2024/01/17 09:43:47 UTC

(incubator-opendal) 01/02: retry 405 errors

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

xuanwo pushed a commit to branch gdrive
in repository https://gitbox.apache.org/repos/asf/incubator-opendal.git

commit 4c1186235abf04d6c170534ecaaf561a398c9245
Author: Xuanwo <gi...@xuanwo.io>
AuthorDate: Wed Jan 17 17:39:58 2024 +0800

    retry 405 errors
    
    Signed-off-by: Xuanwo <gi...@xuanwo.io>
---
 core/src/services/gdrive/error.rs | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/core/src/services/gdrive/error.rs b/core/src/services/gdrive/error.rs
index 9a1360fa3b..8b7ad781ae 100644
--- a/core/src/services/gdrive/error.rs
+++ b/core/src/services/gdrive/error.rs
@@ -45,7 +45,9 @@ pub async fn parse_error(resp: Response<IncomingAsyncBody>) -> Result<Error> {
         StatusCode::INTERNAL_SERVER_ERROR
         | StatusCode::BAD_GATEWAY
         | StatusCode::SERVICE_UNAVAILABLE
-        | StatusCode::GATEWAY_TIMEOUT => (ErrorKind::Unexpected, true),
+        | StatusCode::GATEWAY_TIMEOUT
+        // Gdrive sometimes return METHOD_NOT_ALLOWED for our requests for abuse detection.
+        | StatusCode::METHOD_NOT_ALLOWED => (ErrorKind::Unexpected, true),
         _ => (ErrorKind::Unexpected, false),
     };