talisik-shortener
Version:
JavaScript/TypeScript client for Talisik URL Shortener - A privacy-focused URL shortening service
55 lines • 1.41 kB
TypeScript
/**
* Error classes for Talisik URL Shortener client
*/
/**
* Custom error class for Talisik-specific errors
*/
export declare class TalisikError extends Error {
readonly status?: number;
readonly code?: string;
readonly details?: unknown;
constructor(message: string, status?: number, code?: string, details?: unknown);
/**
* Check if this is a network-related error
*/
isNetworkError(): boolean;
/**
* Check if this is a client error (4xx)
*/
isClientError(): boolean;
/**
* Check if this is a server error (5xx)
*/
isServerError(): boolean;
/**
* Check if this error indicates the resource was not found
*/
isNotFound(): boolean;
/**
* Check if this error indicates a timeout
*/
isTimeout(): boolean;
/**
* Convert error to JSON-serializable object
*/
toJSON(): {
name: string;
message: string;
status: number | undefined;
code: string | undefined;
details: unknown;
};
}
/**
* Error thrown when the Talisik client is not properly configured
*/
export declare class TalisikConfigError extends TalisikError {
constructor(message: string);
}
/**
* Error thrown when a URL validation fails
*/
export declare class TalisikValidationError extends TalisikError {
constructor(message: string);
}
//# sourceMappingURL=errors.d.ts.map