From 2d9a23bc19d32c19ee78ec0714470966c1246354 Mon Sep 17 00:00:00 2001 From: Stefan van Herwijnen Date: Thu, 3 Oct 2024 09:50:12 +0200 Subject: [PATCH] fix: fix trpc error fetch --- packages/app/src/trpc.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/app/src/trpc.ts b/packages/app/src/trpc.ts index e578dbd..3cd6e1e 100644 --- a/packages/app/src/trpc.ts +++ b/packages/app/src/trpc.ts @@ -28,7 +28,7 @@ export const createUseTrpc = async () => { if (!res.ok) { const body = await res.clone().json() - const serverErrors = body?.error + const serverErrors = body?.error || body?.[0]?.error let caption: string const { message, code, path, expected, received } = serverErrors if (message) {