mirror of
https://github.com/ArthurDanjou/trpc-nuxt.git
synced 2026-01-23 00:15:02 +01:00
fix: expect ofetch missing error response type
This commit is contained in:
@@ -9,6 +9,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) => {
|
||||
// @ts-expect-error: ofetch response missing type
|
||||
if (e instanceof FetchError && e.response) { return e.response }
|
||||
throw e
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user