Stream Errors
TheStream module provides Effect-wrapped error types for streaming operations in voltaire-effect. These errors are used by both EventStream and BlockStream for consistent error handling across all streaming infrastructure.
Overview
Stream errors represent failures that can occur during streaming operations:- Abort errors: When streams are cancelled via AbortSignal
- Range errors: When RPC providers reject block range requests
- Reorg errors: When chain reorganizations exceed tracked history
Error Types
StreamAbortedError
Base class for stream abort errors. Thrown when an AbortSignal is triggered during stream operations.EventStreamAbortedError
Thrown when an EventStream operation is aborted.BlockStreamAbortedError
Thrown when a BlockStream operation is aborted.BlockRangeTooLargeError
Thrown when an RPC provider rejects a request because the block range is too large.UnrecoverableReorgError
Thrown when a chain reorganization extends beyond tracked block history. This indicates a “deep reorg” where recovery is not possible without resyncing.Effect Integration
Stream errors work seamlessly with Effect’s error handling usingEffect.catchTag for precise error recovery:
Exhaustive Error Handling
For exhaustive pattern matching over all stream errors:Type Union
TheStreamError type is a union of all stream error types for exhaustive pattern matching:
See Also
- BlockStream Service — Stream blocks with reorg detection
- TransactionStream Service — Track transaction lifecycle
- Event Streaming Example — Stream contract events
- Effect Error Management — Effect error handling
- Voltaire Stream — Core stream documentation

