trace-error-messages

Trace error origins across OpenAPI contracts, React Query hooks, MSW mocks, and UI components.

164|44|Updated Jun 30, 2023
One-click install
npx skills add https://github.com/hivemq/hivemq-edge --skill trace-error-messages
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: trace-error-messages
Source: https://github.com/hivemq/hivemq-edge/tree/main/hivemq-edge-frontend/.claude/skills/trace-error-messages
Command: npx skills add https://github.com/hivemq/hivemq-edge --skill trace-error-messages

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Trace errors to their source across API contracts, mocks, and UI so tests can assert on the right failure cause.

Core Features & Use Cases

  • Identify where an error message originates in the OpenAPI contract, React Query hooks, MSW mock handlers, or UI components.
  • Guide reliable Cypress tests by isolating server vs client side errors and providing clear, actionable steps.
  • Useful for debugging failing error assertions, mocking API errors, and improving test coverage for error states.

Quick Start

Follow the 7-step tracing guide to locate and verify the origin of a failing error message across layers.

Frequently Asked Questions about trace-error-messages

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

FAQPage Schema
How do I trace where a Cypress error message originates across my React Query and MSW setup?

To trace error messages, you follow a 7-step guide that links the OpenAPI contract, React Query hooks, MSW mock handlers, and UI components to isolate the exact source of the failure. This ensures you assert on the correct cause.

Why do my Cypress tests fail when asserting on API error states?

Cypress tests fail when error states are not properly separated between server responses and client-side handling. Tracing errors through the OpenAPI contract and MSW mocks clarifies the expected error shapes and UI rendering.

What is the best way to debug failing error assertions in frontend testing?

The best way to debug failing error assertions is tracing the error message from the UI component back through the React Query hooks and MSW mock handlers to the OpenAPI contract. This enforces clear separation of concerns.

Can I use this approach to mock API errors and improve test coverage for error states?

Yes, you can use this tracing approach to mock API errors accurately by verifying the error shape in the OpenAPI contract. It isolates server versus client side errors to improve test coverage across end-to-end flows.

How does tracing errors through the OpenAPI contract help with form validation testing?

Tracing errors through the OpenAPI contract documents the expected error shapes and links server responses to client handling and UI rendering. This directly supports testing form validation and client-side error displays.

Do I need an OpenAPI contract to trace client-side errors in Cypress?

An OpenAPI contract is needed to trace client-side errors accurately because it documents the expected error shapes. It provides the baseline to link server responses, MSW mocks, and UI rendering across Cypress tests.