Skip to content

Commit 3a03ef9

Browse files
committed
DataConnectError.swift: move OperationFailureResponse.ErrorInfo to top-level struct
1 parent c3cef5a commit 3a03ef9

File tree

1 file changed

+12
-11
lines changed

1 file changed

+12
-11
lines changed

Sources/DataConnectError.swift

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -44,28 +44,29 @@ public protocol AnyOperationFailureResponse {
4444
// JSON string
4545
var data: String? { get }
4646

47-
var errors: [OperationFailureResponse.ErrorInfo] { get }
47+
var errors: [OperationFailureResponseErrorInfo] { get }
4848
}
4949

5050
@available(iOS 15.0, macOS 12.0, tvOS 15.0, watchOS 8.0, *)
5151
public struct OperationFailureResponse<T> : AnyOperationFailureResponse {
5252
// JSON string
5353
public let data: String?
5454

55-
public let errors: [ErrorInfo]
55+
public let errors: [OperationFailureResponseErrorInfo]
5656

5757
public let decodedData: T?
5858

59-
@available(iOS 15.0, macOS 12.0, tvOS 15.0, watchOS 8.0, *)
60-
public struct ErrorInfo: Codable {
61-
public let message: String
62-
public let path: [PathSegment]
59+
}
6360

64-
@available(iOS 15.0, macOS 12.0, tvOS 15.0, watchOS 8.0, *)
65-
public enum PathSegment: Codable {
66-
case field(String)
67-
case listIndex(Int)
68-
}
61+
@available(iOS 15.0, macOS 12.0, tvOS 15.0, watchOS 8.0, *)
62+
public struct OperationFailureResponseErrorInfo: Codable {
63+
public let message: String
64+
public let path: [PathSegment]
6965

66+
@available(iOS 15.0, macOS 12.0, tvOS 15.0, watchOS 8.0, *)
67+
public enum PathSegment: Codable {
68+
case field(String)
69+
case listIndex(Int)
7070
}
71+
7172
}

0 commit comments

Comments
 (0)