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

Function mapFsWatchError

packages/server/src/start.ts:735–763  ·  view source on GitHub ↗
(err: unknown)

Source from the content-addressed store, hash-verified

733}
734
735function mapFsWatchError(err: unknown):
736 | { ok: false; code: number; msg: string } {
737 if (err instanceof FsWatchLimitError) {
738 return {
739 ok: false,
740 code: ErrorCode.FS_WATCH_LIMIT_EXCEEDED,
741 msg: err.message,
742 };
743 }
744 if (err instanceof FsPathEscapesError) {
745 return {
746 ok: false,
747 code: ErrorCode.FS_PATH_ESCAPES_SESSION,
748 msg: err.message,
749 };
750 }
751 if (err instanceof SessionNotFoundError) {
752 return {
753 ok: false,
754 code: ErrorCode.SESSION_NOT_FOUND,
755 msg: 'session not found',
756 };
757 }
758 return {
759 ok: false,
760 code: ErrorCode.INTERNAL_ERROR,
761 msg: err instanceof Error ? err.message : 'fs watch error',
762 };
763}

Callers 2

addFunction · 0.85
removeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected