🎁 Get the FREE AI Skills Starter Guide β€” Subscribe β†’
BytesAgainBytesAgain
πŸ¦€ 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
TriggerAction
- Need consistent error handling
- Want graceful degradation
- Debugging production issues
πŸ’‘ Examples

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.

πŸ“‹ 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

View on ClawHub
TERMINAL
clawhub install nm-leyline-error-patterns

πŸ§ͺ Use this skill with your agent

Most visitors already have an agent. Pick your environment, install or copy the workflow, then run the smoke-test prompt above.

πŸ” Can't find the right skill?

Search 60,000+ AI agent skills β€” free, no login needed.

Search Skills β†’