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
use std::str::Utf8Error;

use thiserror::Error;

#[derive(Error, Debug)]
pub enum OperatorError {
    #[error("An IngressRouteTCP did not have a name")]
    IngressRouteTCPName,

    #[error("An IngressRoute failed to Create, Update, or Delete")]
    IngressRouteError,

    #[error("An IngressRouteTCP failed to Create, Update, or Delete")]
    IngressRouteTcpError,

    #[error("KubeErr: {0}")]
    KubeErr(#[from] kube::Error),

    #[error("ValueError: {0}")]
    ValueError(#[from] ValueError),
}

#[derive(Error, Debug)]
pub enum ValueError {
    #[error("Invalid value: {0}")]
    Invalid(String),
    #[error("Byte error: {0}")]
    ByteError(#[from] Utf8Error),
    #[error("FloatError: {0}")]
    FloatError(#[from] std::num::ParseFloatError),
    #[error("DateTime Parse Error: {0}")]
    ChronoParseError(#[from] chrono::format::ParseError),
}