Skip to content

Error API

FetchError shape

ts
import { createFetchError, isFetchError, isAbortError } from 'tanstack-fetch'

FetchError

FieldMeaning
statusHTTP status (0 for network)
codeMachine-readable code when available
messageHuman message
bodyParsed error body
headersResponse headers when present

Guards

  • isFetchError(error) — narrow thrown HTTP / transport errors
  • isAbortError(error) — aborted / timed out signals

MIT Licensed · Created by Mohammad Garmabi · Not an official TanStack package