Skip to content

Commit 776a1c2

Browse files
authored
Fix NIO deprecations after update to 2.71.0 (#769)
`NIOTooManyBytesError` now requires the `maxBytes` in its initializer.
1 parent e8babad commit 776a1c2

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

Diff for: Package.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ let package = Package(
2121
.library(name: "AsyncHTTPClient", targets: ["AsyncHTTPClient"]),
2222
],
2323
dependencies: [
24-
.package(url: "https://github.com/apple/swift-nio.git", from: "2.62.0"),
24+
.package(url: "https://github.com/apple/swift-nio.git", from: "2.71.0"),
2525
.package(url: "https://github.com/apple/swift-nio-ssl.git", from: "2.27.1"),
2626
.package(url: "https://github.com/apple/swift-nio-http2.git", from: "1.19.0"),
2727
.package(url: "https://github.com/apple/swift-nio-extras.git", from: "1.13.0"),

Diff for: Sources/AsyncHTTPClient/AsyncAwait/HTTPClientResponse.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ extension HTTPClientResponse {
108108
case .transaction(_, let expectedContentLength):
109109
if let contentLength = expectedContentLength {
110110
if contentLength > maxBytes {
111-
throw NIOTooManyBytesError()
111+
throw NIOTooManyBytesError(maxBytes: maxBytes)
112112
}
113113
}
114114
case .anyAsyncSequence:

Diff for: Tests/AsyncHTTPClientTests/AsyncAwaitEndToEndTests.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -907,7 +907,7 @@ final class AsyncAwaitEndToEndTests: XCTestCase {
907907
await XCTAssertThrowsError(
908908
try await response.body.collect(upTo: 3)
909909
) {
910-
XCTAssertEqualTypeAndValue($0, NIOTooManyBytesError())
910+
XCTAssertEqualTypeAndValue($0, NIOTooManyBytesError(maxBytes: 3))
911911
}
912912
}
913913
}

0 commit comments

Comments
 (0)