From 8a2fbf1d6ab146075d6adbb66a8d6c4fffe0943f Mon Sep 17 00:00:00 2001 From: Vladut Date: Wed, 13 Dec 2023 08:44:38 +0200 Subject: [PATCH 1/2] Fix trpc errors deserialization --- src/link/internal/base.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/link/internal/base.ts b/src/link/internal/base.ts index d3cffe2..e70b4da 100644 --- a/src/link/internal/base.ts +++ b/src/link/internal/base.ts @@ -31,7 +31,7 @@ export const createBaseLink = ( if (id !== trpc.id) return; if ('error' in trpc) { - const error = runtime.transformer.deserialize(trpc.error); + const error = trpc.error; observer.error(TRPCClientError.from({ ...trpc, error })); return; } From 89be189b3df098fa031973a911233450d345c4e3 Mon Sep 17 00:00:00 2001 From: Vladut Date: Wed, 13 Dec 2023 08:52:23 +0200 Subject: [PATCH 2/2] address code review --- src/link/internal/base.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/link/internal/base.ts b/src/link/internal/base.ts index e70b4da..90a49c8 100644 --- a/src/link/internal/base.ts +++ b/src/link/internal/base.ts @@ -31,8 +31,7 @@ export const createBaseLink = ( if (id !== trpc.id) return; if ('error' in trpc) { - const error = trpc.error; - observer.error(TRPCClientError.from({ ...trpc, error })); + observer.error(TRPCClientError.from(trpc)); return; }