error-handling

Standardizes error handling for Nuclia frontend monorepo SDK responses, notifications, and retries.

56|18|Updated Apr 26, 2022
One-click install
npx skills add https://github.com/nuclia/frontend --skill error-handling-nuclia
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: error-handling
Source: https://github.com/nuclia/frontend/tree/main/.claude/skills/error-handling
Command: npx skills add https://github.com/nuclia/frontend --skill error-handling-nuclia

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill ensures consistent and user-friendly error handling across the Nuclia frontend monorepo, preventing silent failures and improving the developer and user experience.

Core Features & Use Cases

  • SDK Error Discrimination: Correctly handles different error response types from the Nuclia SDK (IErrorResponse vs. thrown errors).
  • Toast Notifications: Integrates with SisToastService to display user-friendly error messages using i18n keys.
  • Retry Logic: Implements standardized retry mechanisms for rate-limited requests and uploads using provided helpers.
  • Interceptor Awareness: Clarifies the role of AuthInterceptor to avoid redundant error handling for 400/401 errors.
  • UI Error States: Demonstrates patterns for surfacing errors in Svelte (search-widget) and React (rao-widget) components.

Quick Start

Use the error-handling skill to implement a robust error path for an SDK call that returns an IErrorResponse.

Frequently Asked Questions about error-handling

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

FAQPage Schema
How do I handle SDK error responses in a TypeScript frontend without causing silent failures?

Handling SDK error responses in a TypeScript frontend requires discriminating between IErrorResponse objects and thrown errors to prevent silent failures. This approach provides strategies to correctly process these distinct Nuclia SDK response types.

What is the best way to show toast notifications for RxJS error handling in Angular?

Showing toast notifications for RxJS error handling in Angular involves integrating SisToastService with i18n keys to display user-friendly messages. This ensures consistent error surfacing across the application instead of silent failures.

Why does catchError not work as expected when sharing RxJS streams with shareReplay?

The catchError operator often fails when sharing RxJS streams because incorrect shareReplay ordering disrupts the pipeline lifecycle. Addressing this ordering ensures proper error propagation and prevents redundant subscriptions from swallowing exceptions.

Do I need to manually handle 401 authentication errors if I use an AuthInterceptor?

You do not need to manually handle 401 authentication errors if an AuthInterceptor is already implemented. The interceptor manages these requests centrally, and adding manual checks creates redundant error handling logic in your components.

How do I implement retry logic for rate-limited requests in an SDK?

Implementing retry logic for rate-limited requests in an SDK involves using standardized retry configuration helpers provided by the framework. This standardizes the backoff strategy for uploads and prevents immediate request flooding.

Can I use the same error handling patterns for Svelte and React components?

You can use the same error handling patterns for Svelte and React components by applying specific UI error state strategies. This approach demonstrates how to surface SDK errors consistently across both Svelte search-widgets and React rao-widgets.