(error: unknown, filePath: string)
| 399 | } |
| 400 | |
| 401 | function handleMemoryFileReadError(error: unknown, filePath: string): void { |
| 402 | const code = getErrnoCode(error) |
| 403 | // ENOENT = file doesn't exist, EISDIR = is a directory — both expected |
| 404 | if (code === 'ENOENT' || code === 'EISDIR') { |
| 405 | return |
| 406 | } |
| 407 | // Log permission errors (EACCES) as they're actionable |
| 408 | if (code === 'EACCES') { |
| 409 | // Don't log the full file path to avoid PII/security issues |
| 410 | logEvent('tengu_claude_md_permission_error', { |
| 411 | is_access_error: 1, |
| 412 | has_home_dir: filePath.includes(getClaudeConfigHomeDir()) ? 1 : 0, |
| 413 | }) |
| 414 | } |
| 415 | } |
| 416 | |
| 417 | /** |
| 418 | * Used by processMemoryFile → getMemoryFiles so the event loop stays |
no test coverage detected