(entry: ErrorContextEntry)
| 461 | } |
| 462 | |
| 463 | function logErrorContext(entry: ErrorContextEntry): void { |
| 464 | try { |
| 465 | const path = errorLogPath(); |
| 466 | mkdirSync(dirname(path), { recursive: true }); |
| 467 | appendFileSync(path, JSON.stringify(entry) + "\n", "utf-8"); |
| 468 | } catch { |
| 469 | // Logging failure is non-fatal — never block the op. |
| 470 | } |
| 471 | } |
| 472 | |
| 473 | // Test-only export for resetting the gitleaks availability cache between tests. |
| 474 | export function _resetGitleaksAvailabilityCache(): void { |
no test coverage detected