@memory-bank/mcp
Version:
Memory-enabled Co-Pilot (MCP) server for managing project documentation and context
42 lines • 1.98 kB
TypeScript
import { BaseError } from './BaseError.js';
import { ApplicationError, ApplicationErrorCodes, ApplicationErrors } from './ApplicationError.js';
import { DomainError, DomainErrorCodes, DomainErrors } from './DomainError.js';
import { InfrastructureError, InfrastructureErrorCodes, InfrastructureErrors } from './InfrastructureError.js';
import { SharedUtilsError, SharedUtilsErrorCodes, SharedUtilsErrors } from './SharedUtilsError.js';
export { BaseError, ApplicationError, ApplicationErrorCodes, ApplicationErrors, DomainError, DomainErrorCodes, DomainErrors, InfrastructureError, InfrastructureErrorCodes, InfrastructureErrors, SharedUtilsError, SharedUtilsErrorCodes, SharedUtilsErrors };
/**
* Error utility functions for common error handling patterns
*/
export declare const ErrorUtils: {
/**
* Wrap a promise to handle errors consistently
*
* @param promise Promise to wrap
* @param errorMapper Function to map unknown errors to typed errors
* @returns Promise with consistently handled errors
*/
wrapAsync<T>(promise: Promise<T>, errorMapper?: (error: unknown) => Error): Promise<T>;
/**
* Check if an error is an instance of a specific error type by name
* More reliable than instanceof when dealing with errors across module boundaries
*
* @param error Error to check
* @param errorName Name of the error type to check against
*/
isErrorOfType(error: unknown, errorName: string): boolean;
/**
* Get error code from any error (BaseError or standard Error)
*
* @param error Error to extract code from
* @returns Error code or default code for unknown errors
*/
getErrorCode(error: unknown): string;
/**
* Format any error for logging purposes
*
* @param error Error to format
* @returns Formatted error object suitable for logging
*/
formatForLogging(error: unknown): Record<string, unknown>;
};
//# sourceMappingURL=index.d.ts.map