diff options
| -rw-r--r-- | validator/src/types.rs | 11 | 
1 files changed, 11 insertions, 0 deletions
diff --git a/validator/src/types.rs b/validator/src/types.rs index bb176c3..5c62e6d 100644 --- a/validator/src/types.rs +++ b/validator/src/types.rs @@ -59,3 +59,14 @@ impl ValidationErrors {          self.0.is_empty()      }  } + +impl std::error::Error for ValidationErrors { +    fn description(&self) -> &str { "Validation failed" } +    fn cause(&self) -> Option<&std::error::Error> { None } +} + +impl fmt::Display for ValidationErrors { +    fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result { +        fmt::Debug::fmt(self, fmt) +    } +}  | 
