Summary
Improve error messages with structured formatting including error codes and actionable hints.
Details
Add a formatError() function following todoist-cli pattern:
export function formatError(code: string, message: string, hints?: string[]): string {
const lines = [\`Error: \${code}\`, message]
if (hints && hints.length > 0) {
lines.push('')
for (const hint of hints) {
lines.push(\` - \${hint}\`)
}
}
return chalk.red(lines.join('\n'))
}
Example Output
Error: AMBIGUOUS_DOCUMENT
Multiple documents match "Guide":
- "User Guide" (id:abc123)
- "Developer Guide" (id:def456)
Effort
1 day
Reference
Based on todoist-cli pattern in src/lib/output.ts:335-344
Summary
Improve error messages with structured formatting including error codes and actionable hints.
Details
Add a
formatError()function following todoist-cli pattern:Example Output
Effort
1 day
Reference
Based on todoist-cli pattern in
src/lib/output.ts:335-344