1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
//! Error type for the volas core kernel.
use thiserror::Error;
/// Errors raised by the volas core. The Python binding maps each variant to a
/// typed exception (see `volas-python`).
#[derive(Debug, Error, Clone, PartialEq)]
pub enum VolasError {
/// A column name was not found in the frame.
#[error("column \"{0}\" not found")]
ColumnNotFound(String),
/// A dtype-incompatible operation (e.g. appending Bool onto F64).
#[error("dtype error: {0}")]
DType(String),
/// Mismatched lengths / shapes (e.g. columns of unequal height).
#[error("shape error: {0}")]
Shape(String),
/// Out-of-range or otherwise invalid index access.
#[error("index error: {0}")]
Index(String),
/// A bad argument value.
#[error("value error: {0}")]
Value(String),
/// A directive string that could not be tokenized / parsed (a *syntax* error,
/// annotated with line / column), as opposed to a [`Value`](Self::Value) error
/// for a well-formed directive with an invalid command / argument.
#[error("parse error: {0}")]
Parse(String),
}
/// Convenience result alias used throughout the core.
pub type Result<T> = std::result::Result<T, VolasError>;