UNPKG

@knowmax/http-utils

Version:

HTTP utilities for headers, content types, and common HTTP operations

9 lines (8 loc) 311 B
/** Specialized Error for fetch errors which includes the response status and optional data */ export class FetchError extends Error { constructor(response, data) { super(`Request failed with status code ${response.status}`); this.status = response.status; this.data = data; } }