diff --git a/src/client/links.ts b/src/client/links.ts index 61f1004..5ea6b6b 100644 --- a/src/client/links.ts +++ b/src/client/links.ts @@ -12,7 +12,7 @@ import { type FetchEsque } from '@trpc/client/dist/internals/types' function customFetch(input: RequestInfo | URL, init?: RequestInit & { method: 'GET' }) { return globalThis.$fetch.raw(input.toString(), init) .catch((e) => { - if (e.constructor.name === 'FetchError' && e.response) { return e.response } + if (e instanceof Error && e.name === 'FetchError' && e.response) { return e.response } throw e }) .then(response => ({