sda.dashboard.errors#
Error Handling Framework.
Enhanced error handling for dashboard callbacks and components.
Submodules#
Classes#
Structured error information. |
|
Context where error occurred. |
|
Centralized error handling system. |
|
Error recovery strategies. |
|
Error severity levels. |
Functions#
|
Create an error boundary component for displaying errors. |
|
Get the global error handler instance. |
|
Handle callback error with structured error handling. |
Package Contents#
- class sda.dashboard.errors.DashboardError#
Structured error information.
- context: ErrorContext#
- severity: ErrorSeverity#
- timestamp: datetime.datetime#
- class sda.dashboard.errors.ErrorContext(*args, **kwds)#
Bases:
enum.EnumContext where error occurred.
- CALLBACK = 'callback'#
- DATA_LOADING = 'data_loading'#
- PLOTTING = 'plotting'#
- FILTERING = 'filtering'#
- NAVIGATION = 'navigation'#
- INITIALIZATION = 'initialization'#
- class sda.dashboard.errors.ErrorHandler(verbose=False)#
Centralized error handling system.
- verbose = False#
- handle_error(error, context, severity=ErrorSeverity.MEDIUM, callback_id=None, metadata=None)#
Handle an error with appropriate strategy.
- Parameters:
error (
Exception) – The exception that occurredcontext (
ErrorContext) – Context where error occurredseverity (
ErrorSeverity) – Severity level of the errorcallback_id (
Optional[str]) – ID of callback where error occurredmetadata (
Optional[Dict[str,Any]]) – Additional error metadata
- Returns:
Structured error information
- Return type:
- get_user_notifications()#
Get pending user notifications.
- clear_notifications()#
Clear user notifications.
- get_error_summary()#
Get summary of recent errors.
- class sda.dashboard.errors.ErrorRecovery#
Error recovery strategies.
- static retry_with_backoff(func, max_retries=3)#
Retry function with exponential backoff.
- static fallback_to_default(func, default_value)#
Fallback to default value on error.
- static graceful_degradation(func, degraded_func)#
Fall back to degraded functionality on error.
- class sda.dashboard.errors.ErrorSeverity(*args, **kwds)#
Bases:
enum.EnumError severity levels.
- LOW = 'low'#
- MEDIUM = 'medium'#
- HIGH = 'high'#
- CRITICAL = 'critical'#
- sda.dashboard.errors.create_error_boundary(component_id)#
Create an error boundary component for displaying errors.
- Parameters:
component_id (
str) – ID for the error boundary component- Returns:
Error boundary component
- Return type:
html.Div
- sda.dashboard.errors.get_error_handler(verbose=False)#
Get the global error handler instance.
- Parameters:
verbose (
bool) – Whether to enable verbose logging- Returns:
Global error handler instance
- Return type:
- sda.dashboard.errors.handle_callback_error(callback_id, error, context=ErrorContext.CALLBACK, severity=ErrorSeverity.MEDIUM, fallback_value=None)#
Handle callback error with structured error handling.
- Parameters:
callback_id (
str) – ID of the callback that failederror (
Exception) – The exception that occurredcontext (
ErrorContext) – Context where error occurredseverity (
ErrorSeverity) – Severity of the errorfallback_value (
Any) – Value to return on error
- Returns:
Fallback value or dash.no_update
- Return type:
Any