fvtt-error-handling

Standardize Foundry VTT error funnels with Hooks.onError and NotificationOptions.

1|Updated Jan 4, 2026
One-click install
npx skills add https://github.com/ImproperSubset/hh-agentics --skill fvtt-error-handling
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: fvtt-error-handling
Source: https://github.com/ImproperSubset/hh-agentics/tree/main/fvtt-dev/skills/fvtt-error-handling
Command: npx skills add https://github.com/ImproperSubset/hh-agentics --skill fvtt-error-handling

SYSTEM DOCUMENTATION & REQUIREMENTS

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.

Frequently Asked Questions about fvtt-error-handling

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I handle errors in Foundry VTT modules without leaking stack traces to the UI?

To handle errors in Foundry VTT modules without leaking stack traces, separate error funnels from user notifications by logging technical details via Hooks.onError while presenting sanitized messages through ui.notifications.

What is the best way to prevent notification floods from high-frequency errors in Foundry VTT?

The best way to prevent notification floods from high-frequency Foundry VTT errors is applying throttling patterns within standardized error funnels, ensuring repeated failures are consolidated rather than spamming the user interface.

How do I normalize caught exceptions for Foundry VTT debugging using the Error.cause chain?

To normalize caught exceptions for Foundry VTT debugging, validate the error instance using `err instanceof Error ? err : new Error(String(err), { cause: err })` to preserve error origins and structured data context.

Does Foundry VTT V13 support standardized error handling patterns for module development?

Foundry VTT V13 supports standardized error handling for module development through documented APIs like NotificationOptions and Hooks.onError, enabling structured logging and UI separation across hooks, events, and API calls.

Why does my Foundry VTT module show technical error details to users during validation failures?

Foundry VTT modules show technical details during validation failures when error funnels and user notifications are not separated, requiring pattern-driven responses to route developer diagnostics differently than expected user-facing validation messages.