ModuleError needs a cause as well

This commit is contained in:
Matthias Beyer 2015-11-28 15:55:22 +01:00
parent 4a6d1a74c0
commit c3019528cf

View file

@ -15,12 +15,14 @@ pub mod bm;
#[derive(Debug)] #[derive(Debug)]
pub struct ModuleError { pub struct ModuleError {
desc: String, desc: String,
caused_by: Option<Box<Error>>,
} }
impl ModuleError { impl ModuleError {
pub fn new(desc: &'static str) -> ModuleError { pub fn new(desc: &'static str) -> ModuleError {
ModuleError { ModuleError {
desc: desc.to_owned().to_string(), desc: desc.to_owned().to_string(),
caused_by: None,
} }
} }
} }
@ -32,7 +34,7 @@ impl Error for ModuleError {
} }
fn cause(&self) -> Option<&Error> { fn cause(&self) -> Option<&Error> {
None unimplemented!()
} }
} }