1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
use crate::sys::DataType;
use std::ffi::NulError;
use thiserror::Error;

#[derive(Error, Debug)]
pub enum TreeRiteError {
    #[error("Error: {0}")]
    CError(String),

    #[error("Unknown Data Type String: {0}")]
    UnknownDataTypeString(String),

    #[error(transparent)]
    NullError(#[from] NulError),

    #[error("Wrong predict output type, expect: {0}")]
    WrongPredictOutputType(DataType),

    #[error(transparent)]
    ShapeError(#[from] ndarray::ShapeError),

    #[error("Data is not C contiguous")]
    DataNotCContiguous,
}