UNPKG

@straw-hat/fetcher

Version:
16 lines (15 loc) 471 B
export type FetcherErrorOptions = { status: number; statusText: string; body: any; url: string; }; export declare class FetcherError<TBody = any> extends Error { readonly statusText: string; readonly status: number; readonly body: TBody; readonly url: string; constructor(args: FetcherErrorOptions); get message(): string; } export declare function errorFromResponse<TBody = any>(response: Response): Promise<FetcherError<TBody>>;