Options
All
  • Public
  • Public/Protected
  • All
Menu

Class FetchError

An error that can be used to signify when a fetch has failed. It is used by the default check function and is thrown when a fetcher response is not ok (i.e. status is not in the range [200, 299])

It implements the IResponseMutable interface so can be used just like a normal response class. This can be useful for parsing error codes from an API.

Hierarchy

  • Error
    • FetchError

Implements

Index

Constructors

constructor

  • new FetchError(response: INativeResponseMutable): FetchError

Properties

response

response: IResponseMutable

Static Error

Error: ErrorConstructor

Static message

message: string

Static name

name: string

Static Optional stack

stack: undefined | string

Accessors

Url

  • get Url(): IUrlImmutable

bodyUsed

  • get bodyUsed(): boolean

headers

  • get headers(): IHeadersMutable

ok

  • get ok(): boolean

status

  • get status(): number

statusText

  • get statusText(): string

url

  • get url(): string

Methods

arrayBuffer

  • arrayBuffer(): Promise<ArrayBuffer>

clone

  • clone(): IResponseMutable

json

  • json<T>(callback: Convert<T>): Promise<T>
  • json<T>(verify: Verify<T>): Promise<T>
  • json(): Promise<Json>

text

  • text(): Promise<string>