@data-client/rest
Version:
Quickly define typed REST resources and endpoints
24 lines (23 loc) • 716 B
TypeScript
/** An error with a Rest Endpoint fetch
*
* @see https://dataclient.io/rest/api/NetworkError
*/
export default class NetworkError extends Error {
status: number;
response: Response;
name: string;
constructor(response: Response);
/** Serialize the error for logging and debugging.
*
* Error properties are non-enumerable by default, so `JSON.stringify()`
* on a plain Error produces `{}`. This ensures status, message, and the
* request URL are always included in serialized output.
*/
toJSON(): {
name: string;
status: number;
message: string;
url: string;
};
}
//# sourceMappingURL=NetworkError.d.ts.map