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

Function sendMappedError

packages/server/src/routes/workspaces.ts:166–180  ·  view source on GitHub ↗
(
  reply: { send(payload: unknown): unknown },
  requestId: string,
  err: unknown,
)

Source from the content-addressed store, hash-verified

164}
165
166function sendMappedError(
167 reply: { send(payload: unknown): unknown },
168 requestId: string,
169 err: unknown,
170): void {
171 if (err instanceof WorkspaceNotFoundError) {
172 reply.send(errEnvelope(ErrorCode.WORKSPACE_NOT_FOUND, err.message, requestId));
173 return;
174 }
175 if (err instanceof WorkspaceRootNotFoundError) {
176 reply.send(errEnvelope(ErrorCode.FS_PATH_NOT_FOUND, err.message, requestId));
177 return;
178 }
179 throw err;
180}

Callers 1

registerWorkspacesRoutesFunction · 0.70

Calls 2

errEnvelopeFunction · 0.90
sendMethod · 0.65

Tested by

no test coverage detected