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
use thiserror::Error;
#[derive(Debug, Error)]
pub enum SauceError {
#[error("The provided link does not lead to an image file.")]
LinkIsNotImage,
#[error("Unable to format string: {0}")]
UnableToFormat(#[from] strfmt::FmtError),
#[error("Unable to convert to string: {0}")]
UnableToConvertToString(#[from] reqwest::header::ToStrError),
#[error("Unable to convert to float: {0}")]
UnableToConvertToFloat(#[from] std::num::ParseFloatError),
#[error("Failed to send request: {0}")]
FailedRequest(#[from] reqwest::Error),
#[error("Unable to retrieve sauce: {0}")]
UnableToRetrieve(&'static str),
#[error("An error occurred: {0}")]
GenericStr(&'static str),
#[error("An error occurred: {0}")]
GenericString(String),
}