File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change 5
5
// Created by Alsey Coleman Miller on 6/17/25.
6
6
//
7
7
8
+ import Foundation
9
+
8
10
enum MacroError : Error {
9
11
12
+ /// The provided type is invalid.
10
13
case invalidType
14
+
15
+ /// Unknown attribute type
11
16
case unknownAttributeType( for: String )
17
+
18
+ /// Unknown inverse relationship
12
19
case unknownInverseRelationship( for: String )
13
20
}
21
+
22
+ #if canImport(Darwin)
23
+ extension MacroError : LocalizedError {
24
+
25
+ var errorDescription : String ? {
26
+ switch self {
27
+ case . invalidType:
28
+ return NSLocalizedString ( " The provided type is invalid. " , comment: " Invalid type error " )
29
+ case . unknownAttributeType( let type) :
30
+ return String ( format: NSLocalizedString ( " Unknown attribute type: %@ " , comment: " Unknown attribute type error " ) , type)
31
+ case . unknownInverseRelationship( let relationship) :
32
+ return String ( format: NSLocalizedString ( " Unknown inverse relationship for: %@ " , comment: " Unknown inverse relationship error " ) , relationship)
33
+ }
34
+ }
35
+ }
36
+ #endif
You can’t perform that action at this time.
0 commit comments