ky
Version:
Tiny and elegant HTTP client based on the Fetch API
15 lines (13 loc) • 496 B
TypeScript
/**
Wrapper for non-Error values that were thrown.
In JavaScript, any value can be thrown (not just Error instances). This class wraps such values to ensure consistent error handling.
*/
export declare class NonError extends Error {
/**
Returns the value as-is when it is an `Error`, including one from another realm, and otherwise wraps it in a `NonError`.
*/
static wrap(value: unknown): Error;
name: string;
readonly value: unknown;
constructor(value: unknown);
}