/** * Error handling utilities for glancey MCP server. * * Provides structured error types, server-side logging, and debug mode support. */ /** * Error categories for different failure modes */ export type ErrorCategory = 'validation' | 'indexing' | 'search' | 'embedding' | 'config' | 'git' | 'worktree' | 'internal'; /** * Structured error with category and context */ export declare class GlanceyError extends Error { readonly category: ErrorCategory; readonly context?: Record; constructor(message: string, category: ErrorCategory, context?: Record, cause?: Error); } /** * Check if debug mode is enabled via environment variable */ export declare function isDebugMode(): boolean; /** * Log an error server-side with full context. * Always logs to stderr for debugging purposes. */ export declare function logError(error: unknown, toolName?: string): void; /** * Format an error for client response. * In debug mode, includes stack traces. Otherwise, just the message. */ export declare function formatErrorResponse(error: unknown): string; /** * Wrap an error with additional context, preserving the original error. */ export declare function wrapError(message: string, category: ErrorCategory, cause: unknown, context?: Record): GlanceyError; //# sourceMappingURL=errors.d.ts.map