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
50
51
52
use thiserror::Error;
use crate::types::enums::object_type::IcingaObjectType;
#[derive(Debug, Error)]
pub enum Error {
#[error("could not read config file: {0}")]
CouldNotReadConfigFile(std::io::Error),
#[error("could not parse config: {0}")]
CouldNotParseConfig(toml::de::Error),
#[error("could not parse URL in config: {0}")]
CouldNotParseUrlInConfig(url::ParseError),
#[error("could not build reqwest client from supplied information: {0}")]
CouldNotBuildReqwestClientFromSuppliedInformation(reqwest::Error),
#[error("could not read CA certificate file: {0}")]
CouldNotReadCACertFile(std::io::Error),
#[error("could not parse PEM CA certificate: {0}")]
CouldNotParsePEMCACertificate(reqwest::Error),
#[error("error in json serialization/deserialization: {0}")]
SerdeJsonError(#[from] serde_path_to_error::Error<serde_json::Error>),
#[error("empty response body with status: {0}")]
EmptyResponseBody(reqwest::StatusCode),
#[error("reqwest error: {0}")]
ReqwestError(#[from] reqwest::Error),
#[error("could not parse URL fragment: {0}")]
CouldNotParseUrlFragment(url::ParseError),
#[error("filter object type expected one of {0:?} but was {1}")]
FilterObjectTypeMismatch(Vec<IcingaObjectType>, IcingaObjectType),
#[error("uninitialized field in builder: {0}")]
UninitializedFieldInBuilder(#[from] derive_builder::UninitializedFieldError),
#[error("all_services is invalid when targeting a service for a downtime")]
AllServicesInvalidOnServiceDowntime,
#[error("duration is required for flexible downtimes")]
DurationRequiredOnFlexibleDowntime,
}