Module error

Module error 

Source
Expand description

Binance-specific error types.

This module provides module-specific error types for Binance WebSocket operations. These errors can be converted to the core Error type while preserving structured information for downcast capability.

§Example

use ccxt_exchanges::binance::error::BinanceWsError;
use ccxt_core::error::Error as CoreError;

// Create a Binance-specific error
let ws_err = BinanceWsError::subscription_failed("btcusdt@ticker", "Invalid stream");

// Convert to core error for public API
let core_err: CoreError = ws_err.into();

// Downcast back to access structured data
if let Some(binance_err) = core_err.downcast_websocket::<BinanceWsError>() {
    if let Some(stream) = binance_err.stream_name() {
        println!("Failed stream: {}", stream);
    }
}

Enums§

BinanceWsError
Binance WebSocket specific errors.