What problem does it solve?
Inconsistent or lossy error logging makes production failures hard to diagnose. This Skill ensures every logger.error call in the Magic Web frontend follows a structured contract that preserves original Error objects, historical messages, and bounded diagnostic context without leaking sensitive data.
Core Features & Use Cases
- Structured Error Mapping: Guides conversion of legacy
logger.error calls into the { eventKey, errorKind, error, message, context } shape across src, enterprise/src, and customer/src overlays.
- Diagnostic Preservation Rules: Defines how to keep original Error objects, callback parameters, raw parsing evidence, and shared context builders while excluding credentials, tokens, and unbounded objects.
- Review & Verification Workflow: Provides a prioritized review checklist plus verification commands (
rg, vitest, git diff --check) to confirm no diagnostic information was lost.
- Use Case: When migrating a catch block that previously logged
logger.error(\Connection failed: ${error.message}`), the Skill directs you to keep the original Error at top level, assign eventKey: "voice_worker_connection_failed"anderrorKind: "network", and verify the /log-report` and Volcengine probe behavior.
Quick Start
Use the magic-web-error-logging skill to review and migrate the logger.error calls in my changed files to the structured error contract.