From d11217225f2b976d37cf4aa2f6caa43737a80ca3 Mon Sep 17 00:00:00 2001 From: hoslo Date: Mon, 5 Feb 2024 11:35:12 +0800 Subject: [PATCH] fix(services/chainsafe): fix 423 http status --- core/src/services/chainsafe/error.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/core/src/services/chainsafe/error.rs b/core/src/services/chainsafe/error.rs index 5df3cebb3c6d..f998b625a4d9 100644 --- a/core/src/services/chainsafe/error.rs +++ b/core/src/services/chainsafe/error.rs @@ -46,6 +46,10 @@ pub async fn parse_error(resp: Response) -> Result { 401 | 403 => (ErrorKind::PermissionDenied, false), 404 => (ErrorKind::NotFound, false), 304 | 412 => (ErrorKind::ConditionNotMatch, false), + // https://github.com/apache/opendal/issues/4146 + // https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/423 + // We should retry it when we get 423 error. + 423 => (ErrorKind::RateLimited, true), // Service like Upyun could return 499 error with a message like: // Client Disconnect, we should retry it. 499 => (ErrorKind::Unexpected, true),