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

Function handleMemoryFileReadError

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

Source from the content-addressed store, hash-verified

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

Callers 1

Calls 2

getErrnoCodeFunction · 0.85
logEventFunction · 0.85

Tested by

no test coverage detected