Replace every empty catch with deliberate handling: ```ts try { await processOrder(); } catch (error) { throw new Error("process order failed", { cause: error }); } ``` Choose the appropriate action: - Log the error when intentionally continuing, including useful context. - Handle it with an explicit fallback or recovery branch. - Wrap it with context (`new Error("...", { cause: error })` or `fmt.Errorf("process: %w", err)`). - Rethrow it when the caller or boundary must decide. - Map it at t...
Scanned 9/5/2026
Install to Claude Code
npx -y skills add HoangNguyen0403/agent-skills-standard --skill common-error-handling --agent claude-codeInstalls into .claude/skills of the current project.
Are you the author of Common Error Handling?
Add the live security badge to your README — it updates automatically with every re-scan.
[](https://www.skillsdirectory.com/skills/hoangnguyen0403-common-error-handling-e5b2d527)More formats (shields.io, HTML) on the badges page.
Replace every empty catch with deliberate handling:
```ts
try {
await processOrder();
} catch (error) {
throw new Error("process order failed", { cause: error });
}
```
Choose the appropriate action:
- Log the error when intentionally continuing, including useful context.
- Handle it with an explicit fallback or recovery branch.
- Wrap it with context (`new Error("...", { cause: error })` or `fmt.Errorf("process: %w", err)`).
- Rethrow it when the caller or boundary must decide.
- Map it at the API boundary to a standardized JSON error envelope and HTTP response.
- Keep domain errors framework-independent—never place HTTP status codes there.
- In infrastructure code, wrap third-party or database exceptions; do not leak raw DB errors.
- Use `SCREAMING_SNAKE_CASE` error codes such as `ORDER_PAYMENT_FAILED`.
- Return specific `400` validation errors instead of generic `500` responses.
- Never expose stack traces in API responses.
Do not leave `catch(e) {}` or silently ignore failures. If an error is intentionally discarded, document why and at minimum log or explicitly handle that branch.
Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.
No comments yet. Be the first to comment!