more informative decoding errors

This commit is contained in:
Yonas Kolb
2017-08-03 22:02:49 +02:00
parent 7a390bb31a
commit e2fd4eb8fc
+4
View File
@@ -12,6 +12,7 @@ import Commander
import XcodeGenKit
import xcodeproj
import ProjectSpec
import JSONUtilities
func generate(spec: String, project: String?) {
@@ -31,6 +32,9 @@ func generate(spec: String, project: String?) {
do {
spec = try ProjectSpec(path: specPath)
print("Loaded spec: \(spec.targets.count) targets, \(spec.schemes.count) schemes, \(spec.configs.count) configs")
} catch let error as DecodingError {
print("Parsing spec failed: \(error.description)")
return
} catch {
print("Parsing spec failed: \(error.localizedDescription)")
return