ModuleError needs a cause as well
This commit is contained in:
parent
4a6d1a74c0
commit
c3019528cf
1 changed files with 3 additions and 1 deletions
|
@ -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!()
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue