@@ -11,6 +11,10 @@ pub enum Error {
11
11
Network ( String ) ,
12
12
#[ error( "Storage error: {0}" ) ]
13
13
Storage ( String ) ,
14
+ #[ error( "Block validation error: {0}" ) ]
15
+ BlockValidation ( String ) ,
16
+ #[ error( "Bundler error: {0}" ) ]
17
+ Bundler ( String ) ,
14
18
}
15
19
16
20
pub trait WithContext < T > {
@@ -43,7 +47,9 @@ impl From<services::Error> for Error {
43
47
match error {
44
48
services:: Error :: Network ( e) => Self :: Network ( e) ,
45
49
services:: Error :: Storage ( e) => Self :: Storage ( e) ,
46
- services:: Error :: BlockValidation ( e) | services:: Error :: Other ( e) => Self :: Other ( e) ,
50
+ services:: Error :: BlockValidation ( e) => Self :: BlockValidation ( e) ,
51
+ services:: Error :: Bundler ( e) => Self :: Bundler ( e) ,
52
+ services:: Error :: Other ( e) => Self :: Other ( e. to_string ( ) ) ,
47
53
}
48
54
}
49
55
}
@@ -69,6 +75,10 @@ impl<T> WithContext<T> for Result<T> {
69
75
Error :: Other ( e) => Error :: Other ( format ! ( "{}: {}" , context( ) , e) ) ,
70
76
Error :: Network ( e) => Error :: Network ( format ! ( "{}: {}" , context( ) , e) ) ,
71
77
Error :: Storage ( e) => Error :: Storage ( format ! ( "{}: {}" , context( ) , e) ) ,
78
+ Error :: BlockValidation ( e) => {
79
+ Error :: BlockValidation ( format ! ( "{}: {}" , context( ) , e) )
80
+ }
81
+ Error :: Bundler ( e) => Error :: Bundler ( format ! ( "{}: {}" , context( ) , e) ) ,
72
82
} ;
73
83
Err ( new_err)
74
84
} else {
0 commit comments