arcx
Version:
A lightweight, dependency-free fetch utility for APIs and React.
30 lines • 903 B
TypeScript
/**
* @module errors
* This module provides error classes and interfaces
* for handling fetch-related errors in ArcX.
*/
/**
* A base interface for fetch-related errors.
*/
export interface FetchError extends Error {
/** HTTP status code, if applicable (e.g., 404, 500). */
status?: number;
/** Raw text of the response body, if applicable. */
responseBody?: string;
}
/**
* An error class representing HTTP error responses (4xx, 5xx).
*/
export declare class HTTPError extends Error implements FetchError {
status?: number;
responseBody?: string;
constructor(message: string, status?: number, responseBody?: string);
}
/**
* An error class representing network or other unexpected errors
* that are not HTTP errors.
*/
export declare class NetworkError extends Error implements FetchError {
constructor(message: string);
}
//# sourceMappingURL=errors.d.ts.map