SelectoComponents.ErrorHandling.ErrorRecovery (selecto_components v0.3.21)

Error recovery mechanisms with retry logic and exponential backoff.

Link to this section Summary

Functions

Calculates exponential backoff delay.

Classifies an error based on its message or metadata.

Handle retry-related messages in the parent LiveView.

Initializes retry state for a socket.

Preserves current form state for retry.

Resets retry state after successful operation.

Restores preserved state after successful retry.

Component for inline retry button in error displays.

Attempts to retry an operation with exponential backoff.

Component for displaying retry status and controls.

Determines if an error is retryable based on its type.

Schedules a retry after the specified delay.

Link to this section Functions

Link to this function

calculate_backoff(retry_count)

Calculates exponential backoff delay.

Link to this function

classify_error(error)

Classifies an error based on its message or metadata.

Link to this function

handle_retry_message(arg, socket)

Handle retry-related messages in the parent LiveView.

Link to this function

init_retry_state(socket)

Initializes retry state for a socket.

Link to this function

preserve_state(socket, state_to_preserve)

Preserves current form state for retry.

Link to this function

reset_retry_state(socket)

Resets retry state after successful operation.

Link to this function

restore_state(socket)

Restores preserved state after successful retry.

Link to this function

retry_button(assigns)

Component for inline retry button in error displays.

Link to this function

retry_operation(socket, operation_fn, opts \\ [])

Attempts to retry an operation with exponential backoff.

Link to this function

retry_status(assigns)

Component for displaying retry status and controls.

Link to this function

retryable_error?(error)

Determines if an error is retryable based on its type.

Link to this function

schedule_retry(socket, operation_fn, delay_ms)

Schedules a retry after the specified delay.