bc-webclient-mcp
Version:
Model Context Protocol (MCP) server for Microsoft Dynamics 365 Business Central via WebUI protocol. Enables AI assistants to interact with BC through the web client protocol, supporting Card, List, and Document pages with full line item support and server
148 lines • 6.84 kB
TypeScript
/**
* Error Hierarchy for BC MCP Server
*
* Comprehensive error types following SOLID principles.
* All errors are immutable and provide structured error information.
*/
export declare abstract class BCError extends Error {
readonly name: string;
readonly code: string;
readonly timestamp: Date;
readonly context?: Record<string, unknown>;
protected constructor(message: string, code: string, context?: Record<string, unknown>);
toJSON(): Record<string, unknown>;
toString(): string;
}
export declare class ConnectionError extends BCError {
constructor(message: string, context?: Record<string, unknown>);
}
export declare class AuthenticationError extends BCError {
constructor(message: string, context?: Record<string, unknown>);
}
export declare class WebSocketConnectionError extends BCError {
constructor(message: string, context?: Record<string, unknown>);
}
export declare class SessionExpiredError extends BCError {
constructor(message: string, context?: Record<string, unknown>);
}
export declare class TimeoutError extends BCError {
constructor(message: string, context?: Record<string, unknown>);
}
export declare class AbortedError extends BCError {
constructor(message: string, context?: Record<string, unknown>);
}
export declare class NetworkError extends BCError {
constructor(message: string, context?: Record<string, unknown>);
}
export declare class ProtocolError extends BCError {
constructor(message: string, context?: Record<string, unknown>);
}
export declare class JsonRpcError extends BCError {
readonly rpcErrorCode?: number;
constructor(message: string, rpcErrorCode?: number, context?: Record<string, unknown>);
}
export declare class DecompressionError extends BCError {
constructor(message: string, context?: Record<string, unknown>);
}
export declare class InvalidResponseError extends BCError {
constructor(message: string, context?: Record<string, unknown>);
}
export declare class ParseError extends BCError {
constructor(message: string, context?: Record<string, unknown>);
}
export declare class HandlerParseError extends BCError {
readonly handlerType?: string;
constructor(message: string, handlerType?: string, context?: Record<string, unknown>);
}
export declare class ControlParseError extends BCError {
readonly controlType?: string;
constructor(message: string, controlType?: string, context?: Record<string, unknown>);
}
export declare class LogicalFormParseError extends BCError {
constructor(message: string, context?: Record<string, unknown>);
}
export declare class ValidationError extends BCError {
readonly field?: string;
readonly validationErrors?: readonly string[];
constructor(message: string, field?: string, validationErrors?: readonly string[], context?: Record<string, unknown>);
}
export declare class ConfigValidationError extends BCError {
readonly field?: string;
constructor(message: string, field?: string, context?: Record<string, unknown>);
}
export declare class InputValidationError extends BCError {
readonly field?: string;
readonly validationErrors?: readonly string[];
constructor(message: string, field?: string, validationErrors?: readonly string[], context?: Record<string, unknown>);
}
export declare class SchemaValidationError extends BCError {
readonly validationErrors?: readonly string[];
constructor(message: string, validationErrors?: readonly string[], context?: Record<string, unknown>);
}
export declare class BusinessLogicError extends BCError {
constructor(message: string, context?: Record<string, unknown>);
}
export declare class PageNotFoundError extends BCError {
readonly pageId: string;
constructor(pageId: string, message?: string, context?: Record<string, unknown>);
}
export declare class ActionNotFoundError extends BCError {
readonly actionName: string;
constructor(actionName: string, message?: string, context?: Record<string, unknown>);
}
export declare class FieldNotFoundError extends BCError {
readonly fieldName: string;
constructor(fieldName: string, message?: string, context?: Record<string, unknown>);
}
export declare class RecordNotFoundError extends BCError {
readonly recordId: string;
constructor(recordId: string, message?: string, context?: Record<string, unknown>);
}
export declare class PermissionDeniedError extends BCError {
readonly resource?: string;
readonly action?: string;
constructor(message: string, resource?: string, action?: string, context?: Record<string, unknown>);
}
export declare class ActionDisabledError extends BCError {
readonly actionName: string;
constructor(actionName: string, message?: string, context?: Record<string, unknown>);
}
export declare class FieldReadOnlyError extends BCError {
readonly fieldName: string;
constructor(fieldName: string, message?: string, context?: Record<string, unknown>);
}
export declare class MCPError extends BCError {
constructor(message: string, context?: Record<string, unknown>);
}
export declare class MCPToolNotFoundError extends BCError {
readonly toolName: string;
constructor(toolName: string, message?: string, context?: Record<string, unknown>);
}
export declare class MCPResourceNotFoundError extends BCError {
readonly resourceUri: string;
constructor(resourceUri: string, message?: string, context?: Record<string, unknown>);
}
export declare class MCPInvalidArgumentsError extends BCError {
readonly toolName: string;
constructor(toolName: string, message: string, context?: Record<string, unknown>);
}
export declare class InternalError extends BCError {
constructor(message: string, context?: Record<string, unknown>);
}
export declare class NotImplementedError extends BCError {
readonly feature?: string;
constructor(feature?: string, message?: string, context?: Record<string, unknown>);
}
export declare class UnreachableError extends BCError {
constructor(message?: string, context?: Record<string, unknown>);
}
export declare function isConnectionError(error: unknown): error is ConnectionError;
export declare function isAuthenticationError(error: unknown): error is AuthenticationError;
export declare function isProtocolError(error: unknown): error is ProtocolError;
export declare function isParseError(error: unknown): error is ParseError;
export declare function isValidationError(error: unknown): error is ValidationError;
export declare function isBusinessLogicError(error: unknown): error is BusinessLogicError;
export declare function isMCPError(error: unknown): error is MCPError;
export declare function isInternalError(error: unknown): error is InternalError;
export declare function isBCError(error: unknown): error is BCError;
//# sourceMappingURL=errors.d.ts.map