Skip to main content

connectorx/destinations/arrow/
errors.rs

1use thiserror::Error;
2
3/// Result type of the Arrow destination.
4pub type Result<T> = std::result::Result<T, ArrowDestinationError>;
5
6/// Errors raised by the Arrow destination.
7#[derive(Error, Debug)]
8pub enum ArrowDestinationError {
9    /// Error from the `arrow` crate while building arrays or batches.
10    #[error(transparent)]
11    ArrowError(#[from] arrow::error::ArrowError),
12
13    /// Generic ConnectorX error.
14    #[error(transparent)]
15    ConnectorXError(#[from] crate::errors::ConnectorXError),
16
17    /// Error from Polars while converting the batches to a `DataFrame`.
18    #[cfg(feature = "dst_polars")]
19    #[error(transparent)]
20    PolarsError(#[from] polars::error::PolarsError),
21
22    /// Any other errors that are too trivial to be put here explicitly.
23    #[error(transparent)]
24    Other(#[from] anyhow::Error),
25}