CIA Compliance Manager — API Documentation - v1.1.50
    Preparing search index...

    Function handleWidgetError

    • 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);
      }