Skip to content

Commit

Permalink
Fix catch let error warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
adamayoung committed Nov 28, 2023
1 parent 1574b8d commit 362be13
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
3 changes: 1 addition & 2 deletions Tests/TMDbTests/Mocks/Client/MockAPIClient.swift
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,12 @@ final class MockAPIClient: APIClient {
do {
guard let value = try result.get() as? Response else {
preconditionFailure("Can't cast response to type \(String(describing: Response.self))")
// throw TMDbAPIError.unknown
}

return value
} catch let error as TMDbAPIError {
throw error
} catch let error {
} catch {
throw TMDbAPIError.unknown
}
}
Expand Down
2 changes: 1 addition & 1 deletion Tests/TMDbTests/Networking/APIClient/SerialiserTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ final class SerialiserTests: XCTestCase {

do {
_ = try await serialiser.decode(MockObject.self, from: data)
} catch let error {
} catch {
XCTAssertTrue(true)
return
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ final class URLSessionHTTPClientAdapterTests: XCTestCase {
do {
let url = try XCTUnwrap(URL(string: "/error"))
response = try await httpClient.get(url: url, headers: [:])
} catch let error {
} catch {
XCTFail("Unexpected error thrown")
return
}
Expand All @@ -68,7 +68,7 @@ final class URLSessionHTTPClientAdapterTests: XCTestCase {
do {
let url = try XCTUnwrap(URL(string: "/error"))
response = try await httpClient.get(url: url, headers: [:])
} catch let error {
} catch {
XCTFail("Unexpected error thrown")
return
}
Expand All @@ -85,7 +85,7 @@ final class URLSessionHTTPClientAdapterTests: XCTestCase {
do {
let url = try XCTUnwrap(URL(string: "/error"))
response = try await httpClient.get(url: url, headers: [:])
} catch let error {
} catch {
XCTFail("Unexpected error thrown")
return
}
Expand Down

0 comments on commit 362be13

Please sign in to comment.