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

Function installErrorHandler

packages/server/src/error-handler.ts:39–51  ·  view source on GitHub ↗
(app: ErrorHandlerHost)

Source from the content-addressed store, hash-verified

37}
38
39export function installErrorHandler(app: ErrorHandlerHost): void {
40 app.setErrorHandler((err, req, reply) => {
41 const requestId = req.id;
42 req.log.error({ err, request_id: requestId }, 'unhandled error');
43 reply.status(200).send(
44 errEnvelope(
45 ErrorCode.INTERNAL_ERROR,
46 err.message !== undefined && err.message !== '' ? err.message : 'internal error',
47 requestId,
48 ),
49 );
50 });
51}

Callers 2

buildAppFunction · 0.90
startServerFunction · 0.90

Calls 5

errEnvelopeFunction · 0.90
setErrorHandlerMethod · 0.80
errorMethod · 0.65
sendMethod · 0.65
statusMethod · 0.65

Tested by 1

buildAppFunction · 0.72