Skip to content

Commit

Permalink
fix(services/chainsafe): fix 423 http status (apache#4148)
Browse files Browse the repository at this point in the history
  • Loading branch information
hoslo authored Feb 5, 2024
1 parent 8a3a04a commit eb5ae09
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions core/src/services/chainsafe/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ pub async fn parse_error(resp: Response<IncomingAsyncBody>) -> Result<Error> {
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),
Expand Down

0 comments on commit eb5ae09

Please sign in to comment.