@vfarcic/dot-ai
Version:
AI-powered development productivity platform that enhances software development workflows through intelligent automation and AI-driven assistance
202 lines • 7.34 kB
TypeScript
/**
* Error messages and templates
*
* Centralized error messages, categories, and templates for
* comprehensive error handling across the application.
*/
/**
* Network and connectivity error messages
*/
export declare const NETWORK_ERRORS: {
readonly CONNECTION_FAILED: "Failed to establish connection";
readonly TIMEOUT: "Request timeout";
readonly UNREACHABLE: "Service unreachable";
readonly DNS_RESOLUTION_FAILED: "DNS resolution failed";
readonly NETWORK_UNAVAILABLE: "Network unavailable";
};
/**
* Authentication and authorization error messages
*/
export declare const AUTH_ERRORS: {
readonly AUTHENTICATION_FAILED: "Authentication failed. Please verify your credentials.";
readonly UNAUTHORIZED: "Unauthorized access";
readonly INVALID_TOKEN: "Invalid or expired token";
readonly MISSING_CREDENTIALS: "Authentication credentials missing";
readonly INVALID_API_KEY: "Invalid API key provided";
};
/**
* Kubernetes-specific error messages
*/
export declare const KUBERNETES_ERRORS: {
readonly CLUSTER_UNREACHABLE: "Unable to connect to Kubernetes cluster. Please check your kubeconfig and cluster connectivity.";
readonly KUBECONFIG_NOT_FOUND: "Kubeconfig file not found";
readonly INVALID_CONTEXT: "Invalid Kubernetes context";
readonly RESOURCE_NOT_FOUND: "Kubernetes resource not found";
readonly INSUFFICIENT_PERMISSIONS: "Insufficient permissions to access Kubernetes resources";
};
/**
* Kubernetes error templates with detailed troubleshooting
*/
export declare const KUBERNETES_ERROR_TEMPLATES: {
/**
* Authentication error templates
*/
readonly AUTHENTICATION: {
/**
* Bearer token authentication failed
* @param originalError - The original error message
*/
readonly INVALID_TOKEN: (originalError: string) => string;
/**
* Certificate authentication failed
* @param originalError - The original error message
*/
readonly CERTIFICATE_FAILED: (originalError: string) => string;
/**
* Authentication provider not available
* @param originalError - The original error message
*/
readonly PROVIDER_MISSING: (originalError: string) => string;
/**
* Generic authentication failure
* @param originalError - The original error message
*/
readonly GENERIC_FAILED: (originalError: string) => string;
};
/**
* Authorization/RBAC error templates
*/
readonly AUTHORIZATION: {
/**
* CRD discovery permission error
* @param originalError - The original error message
*/
readonly CRD_PERMISSIONS: (originalError: string) => string;
/**
* Forbidden access error
* @param originalError - The original error message
*/
readonly FORBIDDEN: (originalError: string) => string;
/**
* Generic permission denied error
* @param originalError - The original error message
*/
readonly PERMISSION_DENIED: (originalError: string) => string;
};
/**
* API availability error templates
*/
readonly API: {
/**
* API version not supported
* @param originalError - The original error message
*/
readonly VERSION_UNSUPPORTED: (originalError: string) => string;
/**
* API resource not available
* @param originalError - The original error message
*/
readonly RESOURCE_UNAVAILABLE: (originalError: string) => string;
};
/**
* Kubeconfig error templates
*/
readonly KUBECONFIG: {
/**
* Context not found error
* @param originalError - The original error message
*/
readonly CONTEXT_NOT_FOUND: (originalError: string) => string;
/**
* Kubeconfig file not found
* @param originalError - The original error message
*/
readonly FILE_NOT_FOUND: (originalError: string) => string;
/**
* Invalid kubeconfig format
* @param originalError - The original error message
*/
readonly INVALID_FORMAT: (originalError: string) => string;
};
/**
* Version compatibility error template
* @param originalError - The original error message
*/
readonly VERSION_COMPATIBILITY: (originalError: string) => string;
};
/**
* AI service error messages
*/
export declare const AI_SERVICE_ERRORS: {
readonly SERVICE_UNAVAILABLE: "AI service is temporarily unavailable. Please try again later.";
readonly RATE_LIMIT_EXCEEDED: "Rate limit exceeded. Please wait before retrying.";
readonly INVALID_MODEL: "Invalid AI model specified";
readonly API_KEY_INVALID: "AI provider API key is invalid";
readonly QUOTA_EXCEEDED: "AI service quota exceeded";
};
/**
* AI service error templates with dynamic content
*/
export declare const AI_SERVICE_ERROR_TEMPLATES: {
/**
* API key required error template
* @param providerType - The AI provider type requiring the API key
*/
readonly API_KEY_REQUIRED: (providerType: string) => string;
/**
* OpenAI API key required for specific service
* @param service - The service requiring OpenAI API key
*/
readonly OPENAI_KEY_REQUIRED: (service: string) => string;
/**
* AI provider not available error
*/
readonly PROVIDER_NOT_AVAILABLE: "AI provider is not available. No API keys configured. Please set ANTHROPIC_API_KEY, OPENAI_API_KEY, or another supported provider key.";
/**
* Embedding service unavailable error
*/
readonly EMBEDDING_SERVICE_UNAVAILABLE: "embedding service unavailable";
/**
* AI provider not initialized for specific functionality
* @param functionality - The functionality requiring AI provider
*/
readonly PROVIDER_NOT_INITIALIZED: (functionality: string) => string;
/**
* Unsupported provider error
* @param providerType - The unsupported provider type
* @param supportedProviders - List of supported providers
*/
readonly UNSUPPORTED_PROVIDER: (providerType: string, supportedProviders: string[]) => string;
/**
* ResourceRanker not available error
* @param functionality - The specific functionality needing ResourceRanker
*/
readonly RESOURCE_RANKER_UNAVAILABLE: (functionality: string) => string;
};
/**
* Generic error templates
*/
export declare const ERROR_TEMPLATES: {
/**
* Generic error with context
* @param operation - The operation that failed
* @param reason - The reason for failure
*/
readonly OPERATION_FAILED: (operation: string, reason?: string) => string;
/**
* Unexpected error template
* @param context - Context where the error occurred
*/
readonly UNEXPECTED_ERROR: (context?: string) => string;
/**
* Feature not implemented template
* @param feature - The feature that is not implemented
*/
readonly NOT_IMPLEMENTED: (feature: string) => string;
/**
* Dependency missing template
* @param dependency - The missing dependency
*/
readonly DEPENDENCY_MISSING: (dependency: string) => string;
};
//# sourceMappingURL=errors.d.ts.map