We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
testConnectionFailError
1 parent 794dc9d commit b50e2feCopy full SHA for b50e2fe
Tests/AsyncHTTPClientTests/HTTPClientNIOTSTests.swift
@@ -117,7 +117,13 @@ class HTTPClientNIOTSTests: XCTestCase {
117
XCTAssertNoThrow(try httpBin.shutdown())
118
119
XCTAssertThrowsError(try httpClient.get(url: "http://localhost:\(port)/get").wait()) {
120
- XCTAssertEqual($0 as? HTTPClientError, .connectTimeout)
+ if let httpClientError = $0 as? HTTPClientError {
121
+ XCTAssertEqual(httpClientError, .connectTimeout)
122
+ } else if let posixError = $0 as? HTTPClient.NWPOSIXError {
123
+ XCTAssertEqual(posixError.errorCode, .ECONNREFUSED)
124
+ } else {
125
+ XCTFail("unexpected error \($0)")
126
+ }
127
}
128
129
0 commit comments