Loading...
Loading...
Standardized error handling patterns with classification, recovery, and logging strategies. error handling, error recovery, graceful degradation, resilience.
npx skill4agent add athola/claude-night-market error-patterns| 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 |
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--helpfrom 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'"
})--help@dataclass
class ErrorResult:
category: ErrorCategory
message: str
recoverable: bool
suggested_action: str
metadata: dict--help# In your skill's frontmatter
dependencies: [leyline:error-patterns]--helpmodules/classification.mdmodules/recovery-strategies.mdmodules/agent-damage-control.md--verbose