File tree Expand file tree Collapse file tree 2 files changed +13
-6
lines changed Expand file tree Collapse file tree 2 files changed +13
-6
lines changed Original file line number Diff line number Diff line change @@ -5,11 +5,12 @@ import type { ToolBase } from "../tools/tool.js";
55
66export type ConnectionErrorHandler = (
77 error : MongoDBError < ErrorCodes . NotConnectedToMongoDB | ErrorCodes . MisconfiguredConnectionString > ,
8- additionalContext : {
9- availableTools : ToolBase [ ] ;
10- connectionState : AnyConnectionState ;
11- }
12- ) => { errorHandled : false } | { errorHandled : true ; result : CallToolResult } ;
8+ additionalContext : ConnectionErrorHandlerContext
9+ ) => ConnectionErrorUnhandled | ConnectionErrorHandled ;
10+
11+ export type ConnectionErrorHandlerContext = { availableTools : ToolBase [ ] ; connectionState : AnyConnectionState } ;
12+ export type ConnectionErrorUnhandled = { errorHandled : false } ;
13+ export type ConnectionErrorHandled = { errorHandled : true ; result : CallToolResult } ;
1314
1415export const connectionErrorHandler : ConnectionErrorHandler = ( error , { availableTools, connectionState } ) => {
1516 const connectTools = availableTools
Original file line number Diff line number Diff line change @@ -11,5 +11,11 @@ export {
1111 type ConnectionStateErrored ,
1212 type ConnectionManagerFactoryFn ,
1313} from "./common/connectionManager.js" ;
14- export { type ConnectionErrorHandler } from "./common/connectionErrorHandler.js" ;
14+ export type {
15+ ConnectionErrorHandler ,
16+ ConnectionErrorHandled ,
17+ ConnectionErrorUnhandled ,
18+ ConnectionErrorHandlerContext ,
19+ } from "./common/connectionErrorHandler.js" ;
20+ export { ErrorCodes } from "./common/errors.js" ;
1521export { Telemetry } from "./telemetry/telemetry.js" ;
You can’t perform that action at this time.
0 commit comments