epoint_core/
error.rs

1use ecoord::FrameId;
2use thiserror::Error;
3
4#[derive(Error, Debug)]
5pub enum Error {
6    #[error(transparent)]
7    EcoordError(#[from] ecoord::Error),
8    #[error(transparent)]
9    Polars(#[from] polars::error::PolarsError),
10
11    #[error("No data: {0}")]
12    NoData(&'static str),
13    #[error("Lengths don't match: {0}")]
14    ShapeMisMatch(&'static str),
15
16    #[error("Field {0} does not match type")]
17    TypeMisMatch(&'static str),
18    #[error("At column index `{0}` the column name `{1}` is expected, but received `{2}`")]
19    ColumnNameMisMatch(usize, &'static str, String),
20    #[error("unknown data store error")]
21    ObligatoryColumn,
22
23    #[error("column of name `{0}` already exists")]
24    ColumnAlreadyExists(&'static str),
25
26    #[error("Individual points must not contain a frame_id, when the point cloud itself")]
27    MultipleFrameIdDefinitions,
28    #[error(
29        "Point cloud contains no frameId definition (neither in the point cloud info nor the individual points)"
30    )]
31    NoFrameIdDefinitions,
32    #[error("Point cloud does not contain the frame id `{0}`")]
33    NoFrameIdDefinition(FrameId),
34
35    #[error("Point cloud contains no id column")]
36    NoIdColumn,
37    #[error("Point cloud contains no id column")]
38    NoSensorTranslationColumn,
39    #[error("Point cloud contains no id column")]
40    NoSphericalRangeColumn,
41    #[error("Point cloud contains no id column")]
42    NoOctantIndicesColumns,
43
44    #[error("Point cloud contains no id column")]
45    NoRemainingPoints,
46
47    #[error("No row indices specified")]
48    NoRowIndices,
49    #[error("No row indices specified")]
50    RowIndexOutsideRange,
51
52    #[error("No row indices specified")]
53    LowerBoundExceedsUpperBound,
54    #[error("No row indices specified")]
55    LowerBoundEqualsUpperBound,
56    #[error("path is not a directory")]
57    InvalidNumber,
58}