An error without context is useless. Every error should answer: What, Where, Who, When, Why.
Required Attributes
Attribute
Example
Required
error.type
ValidationError, TimeoutError
Yes
error.message
"Invalid email format"
Yes
exception.stacktrace
Full stack trace
Yes
job.name
checkout, signup
Recommended
job.step
payment, validation
Recommended
Error Classification
Level
Status
Action
Critical
500
Page immediately
Error
500
Alert, investigate
Warning
4xx
Track, batch review
Info
-
Log only
Structured Error Type
AppError {
Type string // "validation", "timeout"
Message string // Human-readable
Code string // For grouping
Retryable bool // Can retry?
Context map // Additional context
}
Capture Pattern
On error:
→ Record error on span with error.type, job.name, job.step
→ Set span status to Error
→ Log structured error with trace_id
→ Increment error counter by type/job/step
Fingerprinting
Group by: error type + message (without dynamic data) + top stack frames
Strip from fingerprints: user IDs, request IDs, timestamps, tokens
Run npx get-skill add nexus-labs-automation/error-handling in your terminal (requires Node.js), paste this page's agent-chat prompt into Claude, Cursor, or any MCP-connected agent, or download the SKILL.md file and copy it into your agent's skills directory.
Capture errors with rich context for debugging and alerting It is listed under Coding & Dev Tools on SkillMD.
SkillMD's automated safety review verdict for this skill is PASS. Independent scanners report: SkillSpector: PASS, Skill Scanner: PASS. SkillMD never runs a skill's scripts for you; review the SKILL.md before installing.
This skill is tagged as working with Claude Code, Claude.ai, OpenAI Codex. SKILL.md is an open format, so most agents that read a skills directory can load it too.
Yes. Installing skills from SkillMD is free, and the skill stays under its author's original license.
nexus-labs-automation (@nexus-labs-automation) published this skill. Their other Agent Skills are listed on their SkillMD profile.