MCPcopy
hub / github.com/claude-code-best/claude-code / handleMemoryFileReadError

Function handleMemoryFileReadError

src/utils/claudemd.ts:401–415  ·  view source on GitHub ↗
(error: unknown, filePath: string)

Source from the content-addressed store, hash-verified

399}
400
401function 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

Callers 1

Calls 2

getErrnoCodeFunction · 0.85
logEventFunction · 0.85

Tested by

no test coverage detected