From 578c69e0f88a2d3f3fe4188f24bffb07e33a121b Mon Sep 17 00:00:00 2001 From: Daniel Arantes Loverde Date: Wed, 9 Apr 2025 21:18:50 -0300 Subject: [PATCH] Network Fix --- .../Extensions/LCEssentials+EncodableDecodable.swift | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Sources/LCEssentials/Extensions/LCEssentials+EncodableDecodable.swift b/Sources/LCEssentials/Extensions/LCEssentials+EncodableDecodable.swift index f72313b..5059b74 100644 --- a/Sources/LCEssentials/Extensions/LCEssentials+EncodableDecodable.swift +++ b/Sources/LCEssentials/Extensions/LCEssentials+EncodableDecodable.swift @@ -58,7 +58,8 @@ extension JSONDecoder { let msg = "Type mismatch for type '\(type)' \(T.self) Object: \(context.debugDescription)" error = NSError.createErrorWith(code: 0, description: msg, reasonForError: msg) } 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) } catch { throw error