Nm Leyline Error Patterns

v1.0.0

Standardized error handling patterns with classification, recovery, and logging strategies. error handling, error recovery, graceful degradation, resilience.

0· 63·1 current·1 all-time
Security Scan
VirusTotalVirusTotal
Benign
View report →
OpenClawOpenClaw
Benign
high confidence
Purpose & Capability
The name/description (error handling, recovery, logging, resilience) align with the actual content: classification, recovery strategies, agent-level escalation, and logging patterns. The single declared config requirement (night-market.usage-logging) is relevant to logging behavior. Examples referencing services (gemini, Qwen) are illustrative and reasonable for a cross-service error-patterns library.
Instruction Scope
SKILL.md is instruction-only and stays within error-classification and recovery guidance. It includes patterns that mention writing summaries to files, logging full context, and calling send_alert(log_entry) — these are reasonable for a logging/recovery library but imply file I/O and external alerting. The docs also reference user config paths (e.g. ~/.claude/leyline/) which are outside the declared night-market.usage-logging config and should be reviewed for scope.
Install Mechanism
No install spec and no code files — lowest-risk distribution model. Nothing is downloaded or written to disk by the skill itself beyond the guidance in the text.
Credentials
No environment variables or credentials are requested. The declared config path (night-market.usage-logging) is proportionate to a logging/alerting skill. No unrelated secrets or broad credential access are required.
Persistence & Privilege
always is false and the skill is user-invocable; it does not request persistent or elevated platform presence. The guidance includes writing to files or checkpoints as recovery patterns, which is normal for a resilience library but not a platform-level privilege escalation.
Assessment
This skill is a documentation-only set of error-handling patterns and appears coherent with its purpose. Before installing or enabling it, check: (1) where logs/alerts will be sent (the snippets call send_alert and log full context but don't specify destinations), (2) what the night-market.usage-logging config controls and who can read it, and (3) any filesystem paths referenced in your deployments (e.g. ~/.claude/leyline/ or checkpoint files) to ensure you’re comfortable with the skill's suggested file I/O. No credentials or installs are required, and there are no code files — the main risk is accidental logging of sensitive context if you wire up alerts/logging without review.

Like a lobster shell, security has layers — review code before you run it.

Runtime requirements

🦞 Clawdis
Confignight-market.usage-logging
latestvk97b3rxeyrcj54kwy9t42sxkh984rm5e
63downloads
0stars
1versions
Updated 5d ago
v1.0.0
MIT-0

Night 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

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

LevelActionExample
CriticalHalt, alertAuth failure, service down
ErrorRetry or secondary strategyRate limit, timeout
WarningLog, continuePartial results, deprecation
InfoLog onlyNon-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

Authentication Errors (401/403)

  • Verify credentials exist
  • Check token expiration
  • Validate permissions/scopes
  • Suggest re-authentication

Rate Limit Errors (429)

  • Extract retry-after header
  • Log for quota tracking
  • Implement backoff
  • Consider alternative service

Timeout Errors

  • Increase timeout for retries
  • Break into smaller requests
  • Use async patterns
  • Consider different model

Context Too Large (400)

  • Estimate tokens before request
  • Split into multiple requests
  • Reduce input content
  • Use larger context model

Integration Pattern

# In your skill's frontmatter
dependencies: [leyline:error-patterns]

Verification: Run the command with --help flag to verify availability.

Detailed Resources

  • Classification: See modules/classification.md for error taxonomy
  • Recovery: See modules/recovery-strategies.md for handling patterns
  • Agent Damage Control: See modules/agent-damage-control.md for multi-agent error recovery and escalation

Exit Criteria

  • Error classified correctly
  • Appropriate recovery attempted
  • User-actionable message provided
  • Error logged for debugging

Troubleshooting

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

Comments

Loading comments...