Network Fix

This commit is contained in:
Daniel Arantes Loverde
2025-04-09 21:18:50 -03:00
parent 6040caa2de
commit 578c69e0f8

View File

@@ -58,7 +58,8 @@ extension JSONDecoder {
let msg = "Type mismatch for type '\(type)' \(T.self) Object: \(context.debugDescription)" let msg = "Type mismatch for type '\(type)' \(T.self) Object: \(context.debugDescription)"
error = NSError.createErrorWith(code: 0, description: msg, reasonForError: msg) error = NSError.createErrorWith(code: 0, description: msg, reasonForError: msg)
} catch let DecodingError.valueNotFound(value, context) { } catch let DecodingError.valueNotFound(value, context) {
let msg = "Missing value '\(value)' in \(T.self) Object in JSON: \(context.debugDescription)" let key = context.codingPath.last?.stringValue ?? "unknown_key"
let msg = "Missing value '\(value)' for key '\(key)' in \(T.self) Object in JSON: \(context.debugDescription)"
error = NSError.createErrorWith(code: 0, description: msg, reasonForError: msg) error = NSError.createErrorWith(code: 0, description: msg, reasonForError: msg)
} catch { } catch {
throw error throw error