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