From 08dcd9d1468d1640f6cdfcdceb635f5e730f8a16 Mon Sep 17 00:00:00 2001 From: Riley Testut Date: Mon, 12 Dec 2022 15:53:53 -0600 Subject: [PATCH] [Shared] Fixes error encoding CodableError Int/UInt user info values --- Shared/Server Protocol/CodableError.swift | 1 + 1 file changed, 1 insertion(+) diff --git a/Shared/Server Protocol/CodableError.swift b/Shared/Server Protocol/CodableError.swift index 4cca686c..af108779 100644 --- a/Shared/Server Protocol/CodableError.swift +++ b/Shared/Server Protocol/CodableError.swift @@ -66,6 +66,7 @@ extension CodableError { case let string as String: self = .string(string) case let number as Int: self = .number(number) + case let number as UInt: self = .number(Int(number)) // No idea why this is necessary, but some values fail above cast (despite being in range). And appears to be random :( case let error as NSError: self = .codableError(CodableError(error: error)) case let array as [Any]: self = .array(array.compactMap(UserInfoValue.init)) case let dictionary as [String: Any]: self = .dictionary(dictionary.compactMapValues(UserInfoValue.init))