DOCS
v0.4

AI Components / Error Boundary

Error Boundary

Error display with retry button for AI failures.

ai-collab v0.5.0

Playground

Examples

Rate limit
<ai-error-boundary error="Rate limit exceeded. Please wait 30 seconds." code="RATE_LIMIT" retryable details="Request ID: req_abc123
Model: gpt-4o
Tokens: 4,200" style="max-width:400px;"></ai-error-boundary>

Import

import { AiErrorBoundary } from '@cognivo/components';
// Or tree-shake: import '@cognivo/components/ai-error-boundary';

Per-component imports ship only that component (~8 kB gzip).

API Reference

PropTypeDefaultDescription
error string Error message
code string Error code
retryable boolean true Show retry

Events

EventDetailDescription
ai-error-retry {} Retry clicked