UNPKG

ky

Version:

Tiny and elegant HTTP client based on the Fetch API

14 lines (12 loc) 695 B
/** Base class for all Ky-specific errors. `HTTPError`, `NetworkError`, `TimeoutError`, and `ForceRetryError` extend this class. You can use `instanceof KyError` to check if an error originated from Ky, or use the `isKyError()` type guard for cross-realm compatibility and TypeScript type narrowing. Note: `SchemaValidationError` is intentionally not considered a Ky error. `KyError` covers failures in Ky's HTTP lifecycle (bad status, timeout, retry), while schema validation errors originate from the user-provided schema, not from Ky itself. */ export class KyError extends Error { name = 'KyError'; get isKyError() { return true; } } //# sourceMappingURL=KyError.js.map