From e2e447954bd3ce9abade97973630cf87670b5966 Mon Sep 17 00:00:00 2001 From: zx <67887489+tan-zx@users.noreply.github.com> Date: Thu, 21 Sep 2023 23:37:09 +0800 Subject: [PATCH] refactor: discrete algebra Co-authored-by: Kar Rui Lau --- src/utils/trpc.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/utils/trpc.ts b/src/utils/trpc.ts index e0b0a2f5..dd1cd8e9 100644 --- a/src/utils/trpc.ts +++ b/src/utils/trpc.ts @@ -60,8 +60,7 @@ const isErrorRetryableOnClient = (error: unknown): boolean => { if (typeof window === 'undefined') return true if (!(error instanceof TRPCClientError)) return true const res = TRPCWithErrorCodeSchema.safeParse(error) - if (res.success && NON_RETRYABLE_ERROR_CODES.has(res.data)) return false - return true + return !res.success || !NON_RETRYABLE_ERROR_CODES.has(res.data) } /**