File tree Expand file tree Collapse file tree 2 files changed +3
-14
lines changed Expand file tree Collapse file tree 2 files changed +3
-14
lines changed Original file line number Diff line number Diff line change @@ -70,7 +70,7 @@ private extension PaymentStore {
7070 _ = try await remote. createCart ( siteID: siteID, productID: productID)
7171 completion ( . success( ( ) ) )
7272 } catch {
73- completion ( . failure( CreateCartError ( remoteError : error) ) )
73+ completion ( . failure( error) )
7474 }
7575 }
7676 }
@@ -80,17 +80,4 @@ private extension PaymentStore {
8080public enum CreateCartError : Error , Equatable {
8181 /// Product ID is not in the correct format for WPCOM plans.
8282 case invalidProductID
83- /// Unexpected error from WPCOM.
84- case unexpected( error: DotcomError )
85- /// Unknown error that is not a `DotcomError`.
86- case unknown( description: String )
87-
88- init ( remoteError: Error ) {
89- switch remoteError {
90- case let remoteError as DotcomError :
91- self = . unexpected( error: remoteError)
92- default :
93- self = . unknown( description: remoteError. localizedDescription)
94- }
95- }
9683}
Original file line number Diff line number Diff line change @@ -117,5 +117,7 @@ final class PaymentStoreTests: XCTestCase {
117117
118118 // Then
119119 XCTAssertTrue ( result. isFailure)
120+ let error = try XCTUnwrap ( result. failure)
121+ XCTAssertEqual ( error as? NetworkError , . timeout)
120122 }
121123}
You can’t perform that action at this time.
0 commit comments