error-handling
Installation
SKILL.md
Error Handling
Error classification
- Programming errors: Bugs (TypeError, ReferenceError, assertion failures, etc.). Fix the code; do not catch and continue
- Operational errors: Expected failures (network timeout, file not found, invalid input, etc.). Handle gracefully with recovery, escalation, user notification, or logging
Sync error handling
try {
const result = parse(input);
return result;
} catch (error) {
console.error({ error });
return defaultValue;
}