(info: {
method: string;
path: string;
requestId: string;
phase: 'fetch' | 'parse';
durationMs: number;
status?: number;
error: unknown;
})
| 209 | } |
| 210 | |
| 211 | export 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 |
no test coverage detected