π¦ ClawHub
Nm Leyline Error Patterns
by @athola
Standardized error handling patterns with classification, recovery, and logging strategies. error handling, error recovery, graceful degradation, resilience.
β‘ When to Use
π‘ Examples
Standard Error Handler
from leyline.error_patterns import handle_error, ErrorCategorytry:
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.π Tips & Best Practices
Common Issues
Command not found Ensure all dependencies are installed and in PATH
Permission errors Check file permissions and run with appropriate privileges
Unexpected behavior
Enable verbose logging with --verbose flag
TERMINAL
clawhub install nm-leyline-error-patterns