File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed
Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -31,9 +31,9 @@ public struct Triple: Encodable, Equatable {
3131 public let abiVersion : String ?
3232
3333 public enum Error : Swift . Error {
34- case badFormat
35- case unknownArch
36- case unknownOS
34+ case badFormat( triple : String )
35+ case unknownArch( arch : String )
36+ case unknownOS( os : String )
3737 }
3838
3939 public enum Arch : String , Encodable {
@@ -76,17 +76,17 @@ public struct Triple: Encodable, Equatable {
7676 let components = string. split ( separator: " - " ) . map ( String . init)
7777
7878 guard components. count == 3 || components. count == 4 else {
79- throw Error . badFormat
79+ throw Error . badFormat ( triple : string )
8080 }
8181
8282 guard let arch = Arch ( rawValue: components [ 0 ] ) else {
83- throw Error . unknownArch
83+ throw Error . unknownArch ( arch : components [ 0 ] )
8484 }
8585
8686 let vendor = Vendor ( rawValue: components [ 1 ] ) ?? . unknown
8787
8888 guard let os = Triple . parseOS ( components [ 2 ] ) else {
89- throw Error . unknownOS
89+ throw Error . unknownOS ( os : components [ 2 ] )
9090 }
9191
9292 let osVersion = Triple . parseVersion ( components [ 2 ] )
You can’t perform that action at this time.
0 commit comments