UNPKG

@jokoor/sdk

Version:
50 lines 1.6 kB
/** * Jokoor SDK Error Classes */ export declare class JokoorError extends Error { constructor(message: string); } export declare class JokoorAPIError extends JokoorError { readonly statusCode?: number; readonly code?: string; readonly response?: any; constructor(message: string, statusCode?: number, code?: string, response?: any); } export declare class JokoorAuthenticationError extends JokoorError { constructor(message?: string); } export declare class JokoorPermissionError extends JokoorError { constructor(message?: string); } export declare class JokoorNotFoundError extends JokoorError { constructor(message?: string); } export declare class JokoorRateLimitError extends JokoorError { constructor(message?: string); } export declare class JokoorValidationError extends JokoorError { readonly errors?: { [key: string]: string[]; }; constructor(message?: string, errors?: { [key: string]: string[]; }); } export declare class JokoorNetworkError extends JokoorError { constructor(message?: string); } export declare class JokoorTimeoutError extends JokoorError { constructor(message?: string); } export declare class JokoorWebhookSignatureError extends JokoorError { constructor(message?: string); } /** * Type guard to check if an error is a JokoorError */ export declare function isJokoorError(error: any): error is JokoorError; /** * Helper to create appropriate error from API response */ export declare function createErrorFromResponse(response: any): JokoorError; //# sourceMappingURL=errors.d.ts.map