use thiserror::Error;

use xbbg_core::BlpError;

#[derive(Debug, Error)]
pub enum BlpAsyncError {
    /// Wraps a core BlpError, preserving all structured error context.
    #[error(transparent)]
    Blp(#[from] BlpError),

    /// Bloomberg error (explicit, not From trait)
    #[error("bloomberg error: {0}")]
    BlpError(BlpError),

    #[error("internal error: {0}")]
    Internal(String),

    #[error("configuration error: {detail}")]
    ConfigError { detail: String },

    #[error("channel closed")]
    ChannelClosed,

    #[error("stream full")]
    StreamFull,

    #[error("cancelled")]
    Cancelled,

    #[error("timeout")]
    Timeout,
}
