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("Column `{column}` expects type `{expected}`, but received `{actual}`")]
17    TypeMismatch {
18        column: &'static str,
19        expected: String,
20        actual: String,
21    },
22    #[error("At column index `{0}` the column name `{1}` is expected, but received `{2}`")]
23    ColumnNameMisMatch(usize, &'static str, String),
24    #[error("unknown data store error")]
25    ObligatoryColumn,
26
27    #[error("column of name `{0}` already exists")]
28    ColumnAlreadyExists(&'static str),
29
30    #[error("Individual points must not contain a frame_id, when the point cloud itself")]
31    MultipleFrameIdDefinitions,
32    #[error(
33        "Point cloud contains no frameId definition (neither in the point cloud info nor the individual points)"
34    )]
35    NoFrameIdDefinitions,
36    #[error("Point cloud does not contain the frame id `{0}`")]
37    NoFrameIdDefinition(FrameId),
38
39    #[error("Point cloud contains no id column")]
40    NoIdColumn,
41    #[error("Point cloud contains no id column")]
42    NoSensorTranslationColumn,
43    #[error("Point cloud contains no id column")]
44    NoSphericalRangeColumn,
45    #[error("Point cloud contains no id column")]
46    NoOctantIndicesColumns,
47
48    #[error("Point cloud contains no id column")]
49    NoRemainingPoints,
50
51    #[error("No row indices specified")]
52    NoRowIndices,
53    #[error("No row indices specified")]
54    RowIndexOutsideRange,
55
56    #[error("No row indices specified")]
57    LowerBoundExceedsUpperBound,
58    #[error("No row indices specified")]
59    LowerBoundEqualsUpperBound,
60    #[error("path is not a directory")]
61    InvalidNumber,
62}