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

    Variable handleWidgetError

    handleWidgetError: (error: Error | null | undefined) => string

    Type Declaration

      • (error: Error | null | undefined): string
      • Handle widget errors and format error messages consistently

        Provides consistent error message formatting across all widgets, handling null/undefined errors gracefully with fallback messages.

        Parameters

        • error: Error | null | undefined

          Error object or null/undefined

        Returns string

        Formatted error message string

        handleWidgetError(new Error('Network failed'))  // 'Error: Network failed'
        handleWidgetError(null) // 'Error: Unknown error'
        handleWidgetError(undefined) // 'Error: Unknown error'

        // Usage in error boundary
        try {
        await loadWidgetData();
        } catch (error) {
        const message = handleWidgetError(error as Error);
        showNotification(message);
        }