CIA Compliance Manager API Documentation - v1.0.1
    Preparing search index...

    Class WidgetErrorBoundary

    Error boundary component for wrapping widgets

    Prevents widget failures from crashing the entire application, ensuring users can continue working even when individual components encounter errors. Critical for maintaining operational continuity and user trust. 🛡️

    React Error Boundary that catches JavaScript errors in child components, logs them, and displays a fallback UI. Implements the error boundary lifecycle methods to gracefully handle rendering errors.

    Per React best practices, error boundaries catch errors during:

    • Rendering
    • Lifecycle methods
    • Constructors of child components

    They do NOT catch errors in:

    • Event handlers (use try-catch)
    • Asynchronous code (use try-catch)
    • Server-side rendering
    • Errors in the error boundary itself
    // Basic usage
    <WidgetErrorBoundary>
    <SecurityMetricsWidget />
    </WidgetErrorBoundary>

    // With custom fallback
    <WidgetErrorBoundary fallback={<CustomErrorUI />}>
    <ComplianceWidget />
    </WidgetErrorBoundary>

    // With error callback and widget name
    <WidgetErrorBoundary
    widgetName="Security Metrics"
    onError={(error, info) => logError(error, info)}
    >
    <SecurityMetricsWidget />
    </WidgetErrorBoundary>

    Hierarchy

    • Component<WidgetErrorBoundaryProps, WidgetErrorBoundaryState>
      • WidgetErrorBoundary
    Index

    Constructors

    Methods

    • Log error information and call optional callback

      Parameters

      • error: Error
      • errorInfo: ErrorInfo

      Returns void