(scope: string, runId: string, err: unknown)
| 322 | const providerContext = createProviderContextStore(50); |
| 323 | |
| 324 | const recordFinalError = (scope: string, runId: string, err: unknown): void => { |
| 325 | if (db === null) return; |
| 326 | const code = err instanceof CodesignError ? (err.code as string) : 'PROVIDER_UPSTREAM_ERROR'; |
| 327 | const stack = err instanceof Error ? err.stack : undefined; |
| 328 | const message = err instanceof Error ? err.message : String(err); |
| 329 | const context = providerContext.consume(runId); |
| 330 | recordDiagnosticEvent(db, { |
| 331 | level: 'error', |
| 332 | code, |
| 333 | scope, |
| 334 | runId, |
| 335 | fingerprint: computeFingerprint({ errorCode: code, stack, message }), |
| 336 | message, |
| 337 | stack, |
| 338 | transient: false, |
| 339 | ...(context !== undefined ? { context } : {}), |
| 340 | }); |
| 341 | }; |
| 342 | |
| 343 | /** Adapter so `core` can log step events through the same scoped electron-log |
| 344 | * sink the IPC handler uses. Keeps a single timeline per generation in the |
no test coverage detected