diff --git a/AltStore/Operations/FetchSourceOperation.swift b/AltStore/Operations/FetchSourceOperation.swift index d03104e9..1571fbe8 100644 --- a/AltStore/Operations/FetchSourceOperation.swift +++ b/AltStore/Operations/FetchSourceOperation.swift @@ -136,7 +136,13 @@ final class FetchSourceOperation: ResultOperation catch let error as DecodingError { let nsError = error as NSError - guard let codingPath = nsError.userInfo[ALTNSCodingPathKey] as? [CodingKey] else { throw error } + guard var codingPath = nsError.userInfo[ALTNSCodingPathKey] as? [CodingKey] else { throw error } + + if case .keyNotFound(let key, _) = error + { + // Add missing key to error for better debugging. + codingPath.append(key) + } let rawComponents = codingPath.map { $0.intValue?.description ?? $0.stringValue } let pathDescription = rawComponents.joined(separator: " > ")