UNPKG

@memory-bank/mcp

Version:

Memory-enabled Co-Pilot (MCP) server for managing project documentation and context

62 lines 2.2 kB
import { BaseError } from './BaseError.js'; /** * Error codes for shared utilities */ export declare const SharedUtilsErrorCodes: { readonly UNKNOWN_ERROR: "UNKNOWN_ERROR"; readonly VALIDATION_ERROR: "VALIDATION_ERROR"; readonly CONVERSION_ERROR: "CONVERSION_ERROR"; readonly PARSING_ERROR: "PARSING_ERROR"; readonly FORMAT_ERROR: "FORMAT_ERROR"; readonly INVALID_ARGUMENT: "INVALID_ARGUMENT"; }; /** * Type representing valid shared utils error codes */ export type SharedUtilsErrorCode = keyof typeof SharedUtilsErrorCodes; /** * Error class for shared utilities */ export declare class SharedUtilsError extends BaseError { /** * Create a new SharedUtilsError * * @param code Error code (without prefix) * @param message Human-readable error message * @param details Additional error details * @param options Additional error options */ constructor(code: SharedUtilsErrorCode, message: string, details?: Record<string, unknown>, options?: { cause?: Error; }); /** * Shared utils errors are typically internal/server errors */ getHttpStatusCode(): number; /** * Create a new SharedUtilsError with the same code but a new message * Useful for adding context to existing errors * * @param newMessage New error message * @param additionalDetails Additional details to merge with existing details */ withMessage(newMessage: string, additionalDetails?: Record<string, unknown>): SharedUtilsError; } /** * Factory functions for creating standard shared utils errors */ export declare const SharedUtilsErrors: { /** * Create a validation error */ validationError: (message: string, additionalDetails?: Record<string, unknown>) => SharedUtilsError; /** * Create a parsing error */ parsingError: (message: string, cause?: Error, additionalDetails?: Record<string, unknown>) => SharedUtilsError; /** * Create an invalid argument error */ invalidArgument: (argumentName: string, message: string, additionalDetails?: Record<string, unknown>) => SharedUtilsError; }; //# sourceMappingURL=SharedUtilsError.d.ts.map