File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 55// Created by Alsey Coleman Miller on 6/17/25.
66//
77
8+ import Foundation
9+
810enum MacroError : Error {
911
12+ /// The provided type is invalid.
1013 case invalidType
14+
15+ /// Unknown attribute type
1116 case unknownAttributeType( for: String )
17+
18+ /// Unknown inverse relationship
1219 case unknownInverseRelationship( for: String )
1320}
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