MCPcopy Create free account
hub / github.com/MoonshotAI/kimi-code / mapToWireError

Function mapToWireError

packages/agent-core/src/services/fs/fsService.ts:690–707  ·  view source on GitHub ↗
(err: unknown)

Source from the content-addressed store, hash-verified

688}
689
690function mapToWireError(err: unknown): { code: number; msg: string } {
691 if (err instanceof FsPathNotFoundError) {
692 return { code: 40409, msg: err.message };
693 }
694 if (err instanceof FsIsDirectoryError) {
695 return { code: 40906, msg: err.message };
696 }
697 if (err instanceof FsIsBinaryError) {
698 return { code: 40907, msg: err.message };
699 }
700 if (err instanceof FsTooLargeError) {
701 return { code: 41302, msg: err.message };
702 }
703 if (err instanceof FsTooManyResultsError) {
704 return { code: 41303, msg: err.message };
705 }
706 return { code: 50001, msg: (err as Error)?.message ?? 'internal error' };
707}
708
709registerSingleton(IFsService, FsService, InstantiationType.Delayed);

Callers 1

listManyMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected