error-patterns
'Standardized error handling patterns with classification, recovery, and logging strategies. error handling, error recovery, graceful degradation, resilience.'
Install via CLI (Recommended)
clawhub install openclaw/skills/skills/athola/nm-leyline-error-patternsNight Market Skill — ported from claude-night-market/leyline. For the full experience with agents, hooks, and commands, install the Claude Code plugin.
Table of Contents
- Overview
- When to Use
- Error Classification
- By Severity
- By Recoverability
- Quick Start
- Standard Error Handler
- Error Result
- Common Patterns
- Authentication Errors (401/403)
- Rate Limit Errors (429)
- Timeout Errors
- Context Too Large (400)
- Integration Pattern
- Detailed Resources
- Exit Criteria
Error Patterns
Overview
Standardized error handling patterns for consistent, production-grade behavior across plugins. Provides error classification, recovery strategies, and debugging workflows.
When To Use
- Building resilient integrations
- Need consistent error handling
- Want graceful degradation
- Debugging production issues
When NOT To Use
- Project doesn't use the leyline infrastructure patterns
- Simple scripts without service architecture needs
Error Classification
By Severity
| Level | Action | Example |
|---|---|---|
| Critical | Halt, alert | Auth failure, service down |
| Error | Retry or secondary strategy | Rate limit, timeout |
| Warning | Log, continue | Partial results, deprecation |
| Info | Log only | Non-blocking issues |
By Recoverability
class ErrorCategory(Enum):
TRANSIENT = "transient" # Retry likely to succeed
PERMANENT = "permanent" # Retry won't help
CONFIGURATION = "config" # User action needed
RESOURCE = "resource" # Quota/limit issue
Verification: Run the command with --help flag to verify availability.
Quick Start
Standard Error Handler
from leyline.error_patterns import handle_error, ErrorCategory
try:
result = service.execute(prompt)
except RateLimitError as e:
return handle_error(e, ErrorCategory.RESOURCE, {
"retry_after": e.retry_after,
"service": "gemini"
})
except AuthError as e:
return handle_error(e, ErrorCategory.CONFIGURATION, {
"action": "Run 'gemini auth login'"
})
Verification: Run the command with --help flag to verify availability.
Error Result
@dataclass
class ErrorResult:
category: ErrorCategory
message: str
recoverable: bool
suggested_action: str
metadata: dict
Verification: Run the command with --help flag to verify availability.
Common Patterns
Metadata
Not sure this is the right skill?
Describe what you want to build — we'll match you to the best skill from 16,000+ options.
Find the right skillPaste this into your clawhub.json to enable this plugin.
{
"plugins": {
"official-athola-nm-leyline-error-patterns": {
"enabled": true,
"auto_update": true
}
}
}Related Skills
extract
Analyze a codebase and build a knowledge base of business logic, architecture, data flow, and engineering patterns. The foundation for gauntlet challenges and agent integration
discourse
>- Scan community discussion channels (HN, Lobsters, Reddit, tech blogs) for experience reports and opinions on a topic
synthesize
>- Merge, deduplicate, rank, and format research findings from multiple channels into a coherent report. Use after research agents return their results
workflow-monitor
Detect workflow failures and inefficient patterns, then create GitHub issues for improvement via /fix-workflow
architecture-paradigm-hexagonal
Hexagonal (Ports and Adapters) architecture isolating domain logic from infrastructure