sea_query/
error.rs

1//! Error types used in sea-query.
2
3/// Result type for sea-query
4pub type Result<T> = std::result::Result<T, Error>;
5
6#[derive(Debug, PartialEq, Eq)]
7pub enum Error {
8    /// Column and value vector having different length
9    ColValNumMismatch { col_len: usize, val_len: usize },
10}
11
12impl std::error::Error for Error {}
13
14impl std::fmt::Display for Error {
15    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
16        match self {
17            Self::ColValNumMismatch { col_len, val_len } => write!(
18                f,
19                "Columns and values length mismatch: {col_len} != {val_len}"
20            ),
21        }
22    }
23}