//! Shared error types for pool protocol SDKs.
//!//! Protocol-specific error enums can nest [`PoolError`] via `#[from]` to
//! inherit these common variants while adding their own.
usethiserror::Error;/// Protocol-agnostic errors shared by all pool SDKs.
#[derive(Error, Debug)]pubenumPoolError{/// A math operation failed (overflow, division by zero, etc.).
#[error("math error: {0}")]
Math(String),/// The pool's on-chain state is invalid or inconsistent.
#[error("invalid pool state: {0}")]
InvalidPoolState(String),/// The position data is invalid or does not exist.
#[error("invalid position: {0}")]
InvalidPosition(String),/// Not enough liquidity for the requested operation.
#[error("insufficient liquidity: {0}")]
InsufficientLiquidity(String),/// The price is outside the acceptable range.
#[error("price out of range: {0}")]
PriceOutOfRange(String),/// A transparent wrapper for other errors.
#[error(transparent)]
Other(#[from]anyhow::Error),}