What problem does it solve?
This Skill provides production-ready error handling patterns for Foundry VTT modules, using the documented V13 APIs: NotificationOptions and Hooks.onError. It ensures separation of error funnels from user notifications to prevent leaking technical details while preserving stack traces for debugging.
Core Features & Use Cases
- Error funnel + user notification separation: Logs stack traces via Hooks.onError while presenting sanitized UI messages via ui.notifications.
- Pattern-driven responses: Four patterns cover user-facing failures, expected validation, developer-only diagnostics, and high-frequency errors with throttling.
- Robust debugging context: Uses structured data and the Error.cause chain to preserve error origins and context for ecosystem subscribers.
Quick Start
Prepare catch blocks with the four patterns, normalize errors using const error = err instanceof Error ? err : new Error(String(err), { cause: err });, and route logs and UI messages as described.