sda.dashboard.errors ==================== .. py:module:: sda.dashboard.errors .. autoapi-nested-parse:: Error Handling Framework. ======================== Enhanced error handling for dashboard callbacks and components. Submodules ---------- .. toctree:: :maxdepth: 1 /_api/sda/dashboard/errors/handlers/index Classes ------- .. autoapisummary:: sda.dashboard.errors.DashboardError sda.dashboard.errors.ErrorContext sda.dashboard.errors.ErrorHandler sda.dashboard.errors.ErrorRecovery sda.dashboard.errors.ErrorSeverity Functions --------- .. autoapisummary:: sda.dashboard.errors.create_error_boundary sda.dashboard.errors.get_error_handler sda.dashboard.errors.handle_callback_error Package Contents ---------------- .. py:class:: DashboardError Structured error information. .. py:attribute:: error :type: Exception .. py:attribute:: context :type: ErrorContext .. py:attribute:: severity :type: ErrorSeverity .. py:attribute:: timestamp :type: datetime.datetime .. py:attribute:: callback_id :type: Optional[str] :value: None .. py:attribute:: user_message :type: Optional[str] :value: None .. py:attribute:: technical_details :type: Optional[str] :value: None .. py:attribute:: recovery_actions :type: List[str] :value: [] .. py:attribute:: metadata :type: Dict[str, Any] .. py:class:: ErrorContext(*args, **kwds) Bases: :py:obj:`enum.Enum` Context where error occurred. .. py:attribute:: CALLBACK :value: 'callback' .. py:attribute:: DATA_LOADING :value: 'data_loading' .. py:attribute:: PLOTTING :value: 'plotting' .. py:attribute:: FILTERING :value: 'filtering' .. py:attribute:: NAVIGATION :value: 'navigation' .. py:attribute:: INITIALIZATION :value: 'initialization' .. py:class:: ErrorHandler(verbose = False) Centralized error handling system. .. py:attribute:: verbose :value: False .. py:method:: handle_error(error, context, severity = ErrorSeverity.MEDIUM, callback_id = None, metadata = None) Handle an error with appropriate strategy. :param error: The exception that occurred :type error: :py:class:`Exception` :param context: Context where error occurred :type context: :py:class:`ErrorContext` :param severity: Severity level of the error :type severity: :py:class:`ErrorSeverity` :param callback_id: ID of callback where error occurred :type callback_id: :py:class:`Optional[str]` :param metadata: Additional error metadata :type metadata: :py:class:`Optional[Dict[str`, :py:class:`Any]]` :returns: Structured error information :rtype: :py:class:`DashboardError` .. py:method:: get_user_notifications() Get pending user notifications. .. py:method:: clear_notifications() Clear user notifications. .. py:method:: get_error_summary() Get summary of recent errors. .. py:class:: ErrorRecovery Error recovery strategies. .. py:method:: retry_with_backoff(func, max_retries = 3) :staticmethod: Retry function with exponential backoff. .. py:method:: fallback_to_default(func, default_value) :staticmethod: Fallback to default value on error. .. py:method:: graceful_degradation(func, degraded_func) :staticmethod: Fall back to degraded functionality on error. .. py:class:: ErrorSeverity(*args, **kwds) Bases: :py:obj:`enum.Enum` Error severity levels. .. py:attribute:: LOW :value: 'low' .. py:attribute:: MEDIUM :value: 'medium' .. py:attribute:: HIGH :value: 'high' .. py:attribute:: CRITICAL :value: 'critical' .. py:function:: create_error_boundary(component_id) Create an error boundary component for displaying errors. :param component_id: ID for the error boundary component :type component_id: :py:class:`str` :returns: Error boundary component :rtype: :py:class:`html.Div` .. py:function:: get_error_handler(verbose = False) Get the global error handler instance. :param verbose: Whether to enable verbose logging :type verbose: :py:class:`bool` :returns: Global error handler instance :rtype: :py:class:`ErrorHandler` .. py:function:: handle_callback_error(callback_id, error, context = ErrorContext.CALLBACK, severity = ErrorSeverity.MEDIUM, fallback_value = None) Handle callback error with structured error handling. :param callback_id: ID of the callback that failed :type callback_id: :py:class:`str` :param error: The exception that occurred :type error: :py:class:`Exception` :param context: Context where error occurred :type context: :py:class:`ErrorContext` :param severity: Severity of the error :type severity: :py:class:`ErrorSeverity` :param fallback_value: Value to return on error :type fallback_value: :py:class:`Any` :returns: Fallback value or dash.no_update :rtype: :py:class:`Any`