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
38
39
40
41
42
43
44
45
46
47
48
49
use ecoord::FrameId;
use thiserror::Error;

#[derive(Error, Debug)]
pub enum Error {
    #[error(transparent)]
    EcoordError(#[from] ecoord::Error),
    #[error(transparent)]
    Polars(#[from] polars::error::PolarsError),

    #[error("No data: {0}")]
    NoData(&'static str),
    #[error("Lengths don't match: {0}")]
    ShapeMisMatch(&'static str),

    #[error("Field {0} does not match type")]
    TypeMisMatch(&'static str),
    #[error("At column index `{0}` the column name `{1}` is expected, but received `{2}`")]
    ColumnNameMisMatch(usize, &'static str, String),
    #[error("unknown data store error")]
    ObligatoryColumn,

    #[error("column of name `{0}` already exists")]
    ColumnAlreadyExists(&'static str),

    #[error("Individual points must not contain a frame_id, when the point cloud itself")]
    MultipleFrameIdDefinitions,
    #[error("Point cloud contains no frameId definition (neither in the point cloud info nor the individual points)")]
    NoFrameIdDefinitions,
    #[error("Point cloud does not contain the frame id `{0}`")]
    NoFrameIdDefinition(FrameId),

    #[error("Point cloud contains no id column")]
    NoIdColumn,
    #[error("Point cloud contains no id column")]
    NoBeamOriginColumn,

    #[error("No row indices specified")]
    NoRowIndices,
    #[error("No row indices specified")]
    RowIndexOutsideRange,

    #[error("No row indices specified")]
    LowerBoundExceedsUpperBound,
    #[error("No row indices specified")]
    LowerBoundEqualsUpperBound,
    #[error("path is not a directory")]
    InvalidNumber,
}