Skip to content

Commit

Permalink
feat(ad-hoc): retry additional client errors (#265)
Browse files Browse the repository at this point in the history
  • Loading branch information
andrii-vysotskyi-cko authored Apr 25, 2024
1 parent ebc6ef6 commit ca53829
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,10 @@ final class HttpConnectorRetryDecorator: HttpConnector {
switch failure {
case .networkUnreachable, .timeout:
return true
case .server(_, let statusCode),
.decoding(_, let statusCode):
return (500...599).contains(statusCode) || statusCode == 408
case .server(_, let statusCode), .decoding(_, let statusCode):
let clientErrors: Set = [408, 409, 425, 429]
let serverErrors = (500...599)
return clientErrors.contains(statusCode) || serverErrors.contains(statusCode)
default:
return false
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Generated using Sourcery 2.2.2 — https://github.com/krzysztofzablocki/Sourcery
// Generated using Sourcery 2.2.3 — https://github.com/krzysztofzablocki/Sourcery
// DO NOT EDIT

import Foundation
Expand Down

0 comments on commit ca53829

Please sign in to comment.