@straw-hat/fetcher
Version:
Simple HTTP Client
16 lines (15 loc) • 471 B
TypeScript
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>>;