Skip to content

Commit

Permalink
fix(services/chainsafe): fix 423 http status
Browse files Browse the repository at this point in the history
  • Loading branch information
hoslo committed Feb 5, 2024
1 parent 1b3c95f commit d112172
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 d112172

Please sign in to comment.