error-handler
Skill3 starsChanged 11 months agoApache-2.0View on GitHub
Implement robust error handling patterns. Use when the user needs to add error handling, improve exception management, or create error recovery strategies.
1 other project uses a version of this.
Adopted by
Most recently taken up by
- benshapyro/cadre-devkit-claudetheir own version, first seen Dec 6, 2025
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- benshapyro/cadre-devkit-claude★ 9same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository100 other files it gives its agents.
- accessibility-checkerSkill
- analytics-trackerSkill
- api-contract-testerSkill
- api-documentation-generatorSkill
- api-rate-limiterSkill
- appstore-screenshot-resizerSkill
- architecture-documenterSkill
- authentication-implementerSkill
- aws-resource-provisionerSkill
- browser-extension-builderSkill
- caching-implementerSkill
- changelog-generatorSkill
- chart-generatorSkill
- ci-pipeline-debuggerSkill
- cli-tool-builderSkill
- code-documenterSkill
- code-explainerSkill
- code-migration-helperSkill
- code-refactorerSkill
- code-reviewerSkill
- color-palette-generatorSkill
- comment-generatorSkill
- contributing-guide-writerSkill
- cron-job-schedulerSkill
- css-animatorSkill
- csv-processorSkill
- data-aggregatorSkill
- database-backup-restoreSkill
- database-migration-generatorSkill
- database-query-optimizerSkill
- data-transformerSkill
- data-validatorSkill
- date-time-helperSkill
- debug-helperSkill
- dependency-updaterSkill
- dependency-vulnerability-checkerSkill
- discord-bot-builderSkill
- docker-compose-builderSkill
- dockerfile-generatorSkill
- e2e-test-builderSkill
- email-template-builderSkill
- env-setupSkill
- error-message-writerSkill
- error-response-handlerSkill
- etl-pipeline-builderSkill
- file-organizerSkill
- form-builderSkill
- git-commit-messageSkill
- github-actions-builderSkill
- gitignore-generatorSkill
- graphql-schema-builderSkill
- icon-system-builderSkill
- input-validatorSkill
- integration-test-builderSkill
- jsdoc-generatorSkill
- json-schema-generatorSkill
- kubernetes-manifest-generatorSkill
- license-chooserSkill
- linter-fixerSkill
- load-testerSkill
- The first 60 shown.
The file
Files
Error Handler
Implement comprehensive error handling strategies across languages.
Error Handling Patterns
Try-Catch-Finally
async function fetchUser(id) {
try {
const response = await api.get(`/users/${id}`);
return response.data;
} catch (error) {
if (error.response?.status === 404) {
throw new UserNotFoundError(id);
}
throw new ApiError('Failed to fetch user', error);
} finally {
metrics.recordApiCall('fetchUser');
}
}Result Types (Rust/Go style)
type Result<T, E> = { ok: true; value: T } | { ok: false; error: E };
function parseJson<T>(json: string): Result<T, Error> {
try {
return { ok: true, value: JSON.parse(json) };
} catch (e) {
return { ok: false, error: e as Error };
}
}Error Boundaries (React)
class ErrorBoundary extends React.Component {
state = { hasError: false };
static getDerivedStateFromError(error) {
return { hasError: true };
}
render() {
if (this.state.hasError) {
return <FallbackUI />;
}
return this.props.children;
}
}Best Practices
| Practice | Description |
| Be specific | Catch specific exceptions, not generic |
| Fail fast | Validate inputs early |
| Log context | Include relevant state in error messages |
| Graceful degradation | Provide fallback behavior |
| Don't swallow | Always handle or rethrow |
Custom Error Classes
class AppError(Exception):
def __init__(self, message, code=None, details=None):
super().__init__(message)
self.code = code
self.details = details or {}
class ValidationError(AppError):
def __init__(self, field, message):
super().__init__(f"Validation failed for {field}: {message}")
self.field = fieldDoes it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

