File tree Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -52,7 +52,7 @@ public protocol RelationshipAllowed {
52
52
53
53
extension Model {
54
54
public static func from( _ value: Self ? ) throws -> Self {
55
- try value. unwrap ( or: RuneError . relationshipWasNil)
55
+ try value. unwrap ( or: RuneError . relationshipWasNil ( type : Self . self ) )
56
56
}
57
57
}
58
58
Original file line number Diff line number Diff line change @@ -14,7 +14,9 @@ public struct RuneError: Error {
14
14
public static let notFound = RuneError ( " Unable to find an element of this type. " )
15
15
16
16
/// Couldn't unwrap a relationship that was expected to be nonnil.
17
- public static let relationshipWasNil = RuneError ( " This non-optional relationship had no matching models. " )
17
+ public static func relationshipWasNil< M: Model > ( type: M . Type ) -> RuneError {
18
+ RuneError ( " This non-optional relationship to \( type) has no matching models. " )
19
+ }
18
20
19
21
/// Couldn't sync a model; its id was nil.
20
22
public static let syncErrorNoId = RuneError ( " Can't .sync() an object with a nil `id`. " )
You can’t perform that action at this time.
0 commit comments