df_interchange/
error.rs

1#![allow(clippy::enum_variant_names)]
2
3use thiserror::Error;
4
5pub type Result<T> = std::result::Result<T, InterchangeError>;
6
7#[derive(Error, Debug)]
8pub enum InterchangeError {
9    #[cfg(feature = "polars_0_40")]
10    #[error(transparent)]
11    Polars0_40Error(#[from] polars_crate_0_40::error::PolarsError),
12
13    #[cfg(feature = "polars_0_41")]
14    #[error(transparent)]
15    Polars0_41Error(#[from] polars_crate_0_41::error::PolarsError),
16
17    #[cfg(feature = "polars_0_42")]
18    #[error(transparent)]
19    Polars0_42Error(#[from] polars_crate_0_42::error::PolarsError),
20
21    #[cfg(feature = "polars_0_43")]
22    #[error(transparent)]
23    Polars0_43Error(#[from] polars_crate_0_43::error::PolarsError),
24
25    #[cfg(feature = "polars_0_44")]
26    #[error(transparent)]
27    Polars0_44Error(#[from] polars_crate_0_44::error::PolarsError),
28
29    #[cfg(feature = "polars_0_45")]
30    #[error(transparent)]
31    Polars0_45Error(#[from] polars_crate_0_45::error::PolarsError),
32
33    #[cfg(feature = "polars_0_46")]
34    #[error(transparent)]
35    Polars0_46Error(#[from] polars_crate_0_46::error::PolarsError),
36
37    #[cfg(feature = "arrow_50")]
38    #[error(transparent)]
39    Arrow50Error(#[from] arrow_crate_50::error::ArrowError),
40
41    #[cfg(feature = "arrow_51")]
42    #[error(transparent)]
43    Arrow51Error(#[from] arrow_crate_51::error::ArrowError),
44
45    #[cfg(feature = "arrow_52")]
46    #[error(transparent)]
47    Arrow52Error(#[from] arrow_crate_52::error::ArrowError),
48
49    #[cfg(feature = "arrow_53")]
50    #[error(transparent)]
51    Arrow53Error(#[from] arrow_crate_53::error::ArrowError),
52
53    #[cfg(feature = "arrow_54")]
54    #[error(transparent)]
55    Arrow54Error(#[from] arrow_crate_54::error::ArrowError),
56
57    #[error("Chunks must be aligned when moving data from Polars to Arrow.")]
58    ChunksNotAligned,
59}