Skip to content

Commit

Permalink
fix: expect ofetch missing error response type
Browse files Browse the repository at this point in the history
  • Loading branch information
wobsoriano committed Aug 23, 2023
1 parent 092e349 commit 8f9e398
Show file tree
Hide file tree
Showing 2 changed files with 196 additions and 14 deletions.
209 changes: 195 additions & 14 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions src/client/links.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
})
Expand Down

0 comments on commit 8f9e398

Please sign in to comment.