UNPKG

breathe-api

Version:

Model Context Protocol server for Breathe HR APIs with Swagger/OpenAPI support - also works with custom APIs

51 lines 2.18 kB
export interface ErrorContext { [key: string]: any; } export interface ErrorSuggestion { message: string; action?: string; link?: string; } export declare class BaseError extends Error { readonly code: string; readonly context: ErrorContext; readonly suggestions: ErrorSuggestion[]; readonly timestamp: Date; readonly isRetryable: boolean; constructor(message: string, code: string, context?: ErrorContext, suggestions?: ErrorSuggestion[], isRetryable?: boolean); getUserMessage(): string; toJSON(): Record<string, any>; } export declare class ApiError extends BaseError { readonly statusCode?: number; readonly response?: any; constructor(message: string, statusCode?: number, response?: any, context?: ErrorContext, suggestions?: ErrorSuggestion[]); static fromAxiosError(error: any): ApiError; } export declare class ValidationError extends BaseError { readonly field?: string; readonly value?: any; constructor(message: string, field?: string, value?: any, suggestions?: ErrorSuggestion[]); } export declare class ConfigurationError extends BaseError { constructor(message: string, configKey: string, suggestions?: ErrorSuggestion[]); } export declare class SwaggerParseError extends BaseError { constructor(message: string, swaggerUrl: string, parseError?: any, suggestions?: ErrorSuggestion[]); } export declare class CodeGenerationError extends BaseError { constructor(message: string, platform: string, context?: ErrorContext, suggestions?: ErrorSuggestion[]); } export declare class TimeoutError extends BaseError { constructor(message: string, operation: string, timeoutMs: number, suggestions?: ErrorSuggestion[]); } export declare class CircuitBreakerError extends BaseError { constructor(message: string, service: string, failureCount: number, suggestions?: ErrorSuggestion[]); } export declare function wrapError(error: unknown, context?: ErrorContext, suggestions?: ErrorSuggestion[]): BaseError; export declare function formatErrorForMcp(error: unknown): { message: string; code?: string; context?: ErrorContext; }; //# sourceMappingURL=errors.d.ts.map