File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -5,6 +5,8 @@ pub enum Error {
5
5
Cloudflare ,
6
6
API ,
7
7
Invalid ,
8
+ IO ( std:: io:: Error ) ,
9
+ ParseInt ( std:: num:: ParseIntError ) ,
8
10
}
9
11
10
12
impl From < reqwest:: Error > for Error {
@@ -13,6 +15,18 @@ impl From<reqwest::Error> for Error {
13
15
}
14
16
}
15
17
18
+ impl From < std:: io:: Error > for Error {
19
+ fn from ( value : std:: io:: Error ) -> Self {
20
+ Self :: IO ( value)
21
+ }
22
+ }
23
+
24
+ impl From < std:: num:: ParseIntError > for Error {
25
+ fn from ( value : std:: num:: ParseIntError ) -> Self {
26
+ Self :: ParseInt ( value)
27
+ }
28
+ }
29
+
16
30
impl std:: fmt:: Debug for Error {
17
31
fn fmt ( & self , f : & mut std:: fmt:: Formatter < ' _ > ) -> std:: fmt:: Result {
18
32
std:: fmt:: Display :: fmt ( & self , f)
@@ -26,6 +40,10 @@ impl std::fmt::Display for Error {
26
40
Self :: Cloudflare => "Failed to properly retrieve dns record" . to_string ( ) ,
27
41
Self :: API => "All public ip API failed" . to_string ( ) ,
28
42
Self :: Invalid => "Invalid parsing for DNS record name" . to_string ( ) ,
43
+ Self :: IO ( e) => e. to_string ( ) ,
44
+ Self :: ParseInt ( e) => e. to_string ( ) ,
29
45
} )
30
46
}
31
47
}
48
+
49
+ impl std:: error:: Error for Error { }
You can’t perform that action at this time.
0 commit comments