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
use metfor;
#[derive(Clone, Copy, PartialEq, Eq, Debug, Fail)]
pub enum AnalysisError {
#[fail(display = "Missing profile required for the analysis.")]
MissingProfile,
#[fail(display = "Missing value required for analysis.")]
MissingValue,
#[fail(display = "Not enough data available for analysis.")]
NotEnoughData,
#[fail(display = "Profile is full of missing values, cannot do analysis.")]
NoDataProfile,
#[fail(display = "Invalid input.")]
InvalidInput,
#[fail(display = "None value encountered during interpolation.")]
InterpolationError,
#[fail(display = "Error bubbled up from metfor crate: {}", _0)]
MetForError(metfor::MetForErr),
}
pub type Result<T> = ::std::result::Result<T, AnalysisError>;
impl From<metfor::MetForErr> for AnalysisError {
fn from(err: metfor::MetForErr) -> Self {
AnalysisError::MetForError(err)
}
}