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

Function traceRestFailure

apps/kimi-web/src/debug/trace.ts:211–232  ·  view source on GitHub ↗
(info: {
  method: string;
  path: string;
  requestId: string;
  phase: 'fetch' | 'parse';
  durationMs: number;
  status?: number;
  error: unknown;
})

Source from the content-addressed store, hash-verified

209}
210
211export function traceRestFailure(info: {
212 method: string;
213 path: string;
214 requestId: string;
215 phase: 'fetch' | 'parse';
216 durationMs: number;
217 status?: number;
218 error: unknown;
219}): void {
220 if (!isTraceEnabled()) return;
221 push({
222 source: 'rest',
223 kind: 'rest:error',
224 label: `✕ ${info.method} ${info.path} ${info.phase} error${info.status !== undefined ? ` (HTTP ${info.status})` : ''} ${Math.round(info.durationMs)}ms`,
225 method: info.method,
226 path: info.path,
227 requestId: info.requestId,
228 status: info.status,
229 durationMs: info.durationMs,
230 detail: { phase: info.phase, error: String(info.error) },
231 });
232}
233
234// ---------------------------------------------------------------------------
235// WS recording — called from DaemonEventSocket

Callers 3

getBlobMethod · 0.90
postFormMethod · 0.90
requestMethod · 0.90

Calls 2

isTraceEnabledFunction · 0.85
pushFunction · 0.70

Tested by

no test coverage detected