Skip to content

Commit

Permalink
Merge pull request #136 from amzn/cancelled_as_connection_failure
Browse files Browse the repository at this point in the history
Treat AsyncHTTPClient.HTTPClientError.cancelled as a connection failure.
  • Loading branch information
tachyonics authored Dec 12, 2023
2 parents 9c71b33 + 9609776 commit d37f4c4
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Sources/SmokeHTTPClient/HTTPOperationsClient.swift
Original file line number Diff line number Diff line change
Expand Up @@ -582,9 +582,10 @@ extension HTTPOperationsClient {
|| clientError == AsyncHTTPClient.HTTPClientError.connectTimeout
|| clientError == AsyncHTTPClient.HTTPClientError.getConnectionFromPoolTimeout {
return clientError
// special case tls handshake timeouts and remote connection closed errors, treat as a connection failures
// special case tls handshake timeouts, remote connection closed and cancelled errors, treat as a connection failures
} else if clientError == AsyncHTTPClient.HTTPClientError.tlsHandshakeTimeout
|| clientError == AsyncHTTPClient.HTTPClientError.remoteConnectionClosed {
|| clientError == AsyncHTTPClient.HTTPClientError.remoteConnectionClosed
|| clientError == AsyncHTTPClient.HTTPClientError.cancelled {
return HTTPError.connectionFailure(cause: clientError)
}

Expand Down

0 comments on commit d37f4c4

Please sign in to comment.