File tree Expand file tree Collapse file tree 2 files changed +13
-0
lines changed
Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -142,6 +142,8 @@ pub enum ValidationError {
142142 ActiveElementSegmentTypeMismatch ,
143143}
144144
145+ impl core:: error:: Error for ValidationError { }
146+
145147impl Display for ValidationError {
146148 fn fmt ( & self , f : & mut Formatter < ' _ > ) -> core:: fmt:: Result {
147149 match self {
Original file line number Diff line number Diff line change @@ -39,6 +39,15 @@ impl Display for RuntimeError {
3939 }
4040}
4141
42+ impl core:: error:: Error for RuntimeError {
43+ fn source ( & self ) -> Option < & ( dyn core:: error:: Error + ' static ) > {
44+ match self {
45+ RuntimeError :: Trap ( trap_err) => Some ( trap_err) ,
46+ _ => None ,
47+ }
48+ }
49+ }
50+
4251#[ derive( Debug , PartialEq , Eq , Clone ) ]
4352pub enum TrapError {
4453 DivideBy0 ,
@@ -90,6 +99,8 @@ impl Display for TrapError {
9099 }
91100}
92101
102+ impl core:: error:: Error for TrapError { }
103+
93104impl From < TrapError > for RuntimeError {
94105 fn from ( value : TrapError ) -> Self {
95106 Self :: Trap ( value)
You can’t perform that action at this time.
0 commit comments