diff --git a/src/error.rs b/src/error.rs index 3c938cc..cd4daac 100644 --- a/src/error.rs +++ b/src/error.rs @@ -12,6 +12,13 @@ pub struct Error { } impl Error { + pub fn new(message: String, source: E) -> Self { + Self { + message, + source: Some(Box::new(source)), + } + } + fn wrap(value: E) -> Option> { Some(Box::new(value)) }