Log cached infra JSON when unable to parse
This commit is contained in:
parent
125c6a7d67
commit
b714f8acd9
|
@ -106,7 +106,12 @@ public class InfrastructureFactory {
|
||||||
guard let data = try? Data(contentsOf: entry) else {
|
guard let data = try? Data(contentsOf: entry) else {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
guard let infra = try? decoder.decode(Infrastructure.self, from: data) else {
|
let infra: Infrastructure
|
||||||
|
do {
|
||||||
|
infra = try decoder.decode(Infrastructure.self, from: data)
|
||||||
|
} catch let e {
|
||||||
|
log.warning("Unable to load infrastructure \(entry.lastPathComponent): \(e)")
|
||||||
|
log.warning("\(String(data: data, encoding: .utf8)!)")
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue