Skip to main content

Module error

Module error 

Source
Expand description

Error types and error handling strategy for Asupersync.

This module defines the core error types used throughout the runtime. Error handling follows these principles:

  • Errors are explicit and typed (no stringly-typed errors)
  • Errors compose well with the Outcome severity lattice
  • Panics are isolated and converted to Outcome::Panicked
  • Errors are classified by recoverability for retry logic

§Error Categories

Errors are organized into categories:

  • Cancellation: Operation cancelled by request or timeout
  • Budgets: Resource limits exceeded (deadlines, quotas)
  • Channels: Communication primitive errors
  • Obligations: Linear resource tracking violations
  • Regions: Ownership and lifecycle errors
  • Encoding: RaptorQ encoding pipeline errors
  • Decoding: RaptorQ decoding pipeline errors
  • Transport: Symbol routing and transmission errors
  • Distributed: Distributed region coordination errors
  • Internal: Runtime bugs and invalid states

§Recovery Classification

All errors can be classified by Recoverability:

  • Transient: Temporary failure, safe to retry
  • Permanent: Unrecoverable, do not retry
  • Unknown: Recoverability depends on context

Modules§

recovery
Recovery strategies for handling transient errors.

Structs§

BackoffHint
Hints for configuring exponential backoff.
Cancelled
Marker type for cancellation, carrying a reason.
Error
The main error type for Asupersync operations.
ErrorContext
Diagnostic context for an error.

Enums§

AcquireError
Error when acquiring a semaphore-like permit.
ErrorCategory
High-level error category for grouping related errors.
ErrorKind
The kind of error.
Recoverability
Classification of error recoverability for retry logic.
RecoveryAction
Recommended recovery action for an error.
RecvError
Error when receiving from a channel.
SendError
Error when sending on a channel.

Traits§

ResultExt
Extension trait for adding context to Results.

Type Aliases§

Result
A specialized Result type for Asupersync operations.