Skip to content

Commit 8bc19e7

Browse files
Remove DataConnectError conformance
AnyDataConnectError just becomes a container of DataConnectError so it can contain both base and domain errors
1 parent 95fc74e commit 8bc19e7

File tree

2 files changed

+3
-11
lines changed

2 files changed

+3
-11
lines changed

Sources/DataConnectError.swift

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -36,20 +36,12 @@ public extension DataConnectError {
3636

3737
/// Type erased DataConnectError
3838
@available(iOS 15.0, macOS 12.0, tvOS 15.0, watchOS 8.0, *)
39-
public struct AnyDataConnectError: DataConnectError {
39+
public struct AnyDataConnectError: Error {
4040
public let dataConnectError: DataConnectError
4141

4242
init<E: DataConnectError>(dataConnectError: E) {
4343
self.dataConnectError = dataConnectError
4444
}
45-
46-
public var message: String? {
47-
return dataConnectError.message
48-
}
49-
50-
public var underlyingError: (any Error)? {
51-
return dataConnectError.underlyingError
52-
}
5345
}
5446

5547
@available(iOS 15.0, macOS 12.0, tvOS 15.0, watchOS 8.0, *)

Sources/QueryRef.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ public class QueryRefObservableObject<
168168
self.data = resultData
169169
self.lastError = nil
170170
case let .failure(dcerror):
171-
self.lastError = dcerror
171+
self.lastError = dcerror.dataConnectError
172172
}
173173
})
174174
}
@@ -244,7 +244,7 @@ public class QueryRefObservation<
244244
self.data = resultData
245245
self.lastError = nil
246246
case let .failure(dcerror):
247-
self.lastError = dcerror
247+
self.lastError = dcerror.dataConnectError
248248
}
249249
})
250250
}

0 commit comments

Comments
 (0)