From 14f49dcc98c921e3be514c5e1c3310c129e9dbd3 Mon Sep 17 00:00:00 2001 From: Lukas Schmidt Date: Mon, 25 Nov 2024 13:28:57 +0100 Subject: [PATCH] Improves Mock errors --- Source/NetworkServices/NetworkServiceMock.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/NetworkServices/NetworkServiceMock.swift b/Source/NetworkServices/NetworkServiceMock.swift index 1d8c1b3..cce6ead 100644 --- a/Source/NetworkServices/NetworkServiceMock.swift +++ b/Source/NetworkServices/NetworkServiceMock.swift @@ -185,7 +185,7 @@ public final class NetworkServiceMock: NetworkService, @unchecked Sendable { let result = try resource.parse(data) return .success((result, httpURLResponse)) } catch { - fatalError("Not able to parse data. Error: \(error)") + return .failure(.serializationError(error: error, response: httpURLResponse, data: data)) } case .failure(let error): return .failure(error)