UNPKG

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

40 lines 1.27 kB
/** * BC Error Normalizer * * Normalizes Business Central HTTP responses into typed BCError subclasses. * Used at the HTTP client boundary to map status codes and error bodies * to appropriate error types. */ /** * BC error response body structure (when available) */ export interface BCErrorBody { error?: { code?: string; message?: string; details?: unknown; }; message?: string; Message?: string; ExceptionMessage?: string; ExceptionType?: string; } /** * Normalizes BC HTTP error into a typed BCError. * Throws the appropriate BCError subclass - does not return. * * @param status - HTTP status code * @param body - Optional error response body * @param context - Additional context for debugging * @throws {BCError} - Always throws the appropriate BCError subclass */ export declare function normalizeBCError(status: number, body?: BCErrorBody, context?: Record<string, unknown>): never; /** * Checks if an HTTP status code represents an error. */ export declare function isErrorStatus(status: number): boolean; /** * Type guard to check if a value is a BC error body. */ export declare function isBCErrorBody(value: unknown): value is BCErrorBody; //# sourceMappingURL=bc-error-normalizer.d.ts.map