Use is5xxServiceResponse in a few places

This commit is contained in:
Max Radermacher 2026-04-16 13:39:52 -05:00 committed by GitHub
parent 91af33f8c4
commit dc8aabc6f6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 2 deletions

View File

@ -209,7 +209,7 @@ struct UploadEndpointCDN2: UploadEndpoint {
switch error {
case let error as Upload.Error:
throw error
case let error as OWSHTTPError where (500...599).contains(error.responseStatusCode):
case let error as OWSHTTPError where error.is5xxServiceResponse:
// On 5XX errors, clients should try to resume the upload
attempt.logger.warn("Temporary upload failure [\(error.responseStatusCode)], retry.")
// Check for any progress here

View File

@ -179,7 +179,7 @@ struct UploadEndpointCDN3: UploadEndpoint {
// On 4XX errors, clients should restart the upload
attempt.logger.warn("Unexpected upload failure [\(error.responseStatusCode)], restart.\(debugInfo)")
throw Upload.Error.uploadFailure(recovery: .restart(retryMode))
case let error where (500...599).contains(error.responseStatusCode):
case let error where error.is5xxServiceResponse:
// On 5XX errors, clients should try to resume the upload
attempt.logger.warn("Temporary upload failure [\(error.responseStatusCode)], retry.\(debugInfo)")
throw Upload.Error.uploadFailure(recovery: .resume(retryMode))