-
Notifications
You must be signed in to change notification settings - Fork 2
dx: add consistent error messages with error codes to storage engine functions #70
Copy link
Copy link
Open
Labels
dxDeveloper experience improvementsDeveloper experience improvementsgood first issueGood for newcomersGood for newcomers
Description
The storage engine (src/storage/engine.ts) functions like atomicWrite, appendLine, and writeJson catch and re-throw errors, but the error messages do not include the file path that failed or a consistent error code prefix. When a storage operation fails deep in the call stack, the error message should make it immediately clear which file and which operation failed. Add an AXME_STORAGE prefix and include the file path in all re-thrown errors.
Relevant files:
src/storage/engine.ts— wrap caught errors with contextual messages
Example improvement:
// Before:
throw err;
// After:
throw new Error(`AXME_STORAGE: atomicWrite failed for ${filePath}: ${(err as Error).message}`, { cause: err });Acceptance criteria:
- All functions that can throw (
atomicWrite,appendLine,writeJson) include the file path and operation name in the error message - Error messages have a consistent
AXME_STORAGE:prefix - Original error is preserved as
cause npm run lintandnpm testpass
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
dxDeveloper experience improvementsDeveloper experience improvementsgood first issueGood for newcomersGood for newcomers