Skip to content

Commit

Permalink
Fix NIO deprecations after update to 2.71.0 (#769)
Browse files Browse the repository at this point in the history
`NIOTooManyBytesError` now requires the `maxBytes` in its initializer.
  • Loading branch information
fabianfett authored Sep 3, 2024
1 parent e8babad commit 776a1c2
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ let package = Package(
.library(name: "AsyncHTTPClient", targets: ["AsyncHTTPClient"]),
],
dependencies: [
.package(url: "https://github.com/apple/swift-nio.git", from: "2.62.0"),
.package(url: "https://github.com/apple/swift-nio.git", from: "2.71.0"),
.package(url: "https://github.com/apple/swift-nio-ssl.git", from: "2.27.1"),
.package(url: "https://github.com/apple/swift-nio-http2.git", from: "1.19.0"),
.package(url: "https://github.com/apple/swift-nio-extras.git", from: "1.13.0"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ extension HTTPClientResponse {
case .transaction(_, let expectedContentLength):
if let contentLength = expectedContentLength {
if contentLength > maxBytes {
throw NIOTooManyBytesError()
throw NIOTooManyBytesError(maxBytes: maxBytes)
}
}
case .anyAsyncSequence:
Expand Down
2 changes: 1 addition & 1 deletion Tests/AsyncHTTPClientTests/AsyncAwaitEndToEndTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -907,7 +907,7 @@ final class AsyncAwaitEndToEndTests: XCTestCase {
await XCTAssertThrowsError(
try await response.body.collect(upTo: 3)
) {
XCTAssertEqualTypeAndValue($0, NIOTooManyBytesError())
XCTAssertEqualTypeAndValue($0, NIOTooManyBytesError(maxBytes: 3))
}
}
}
Expand Down

0 comments on commit 776a1c2

Please sign in to comment.