Use ParserError::with_cause() and build new ParserError object

This commit is contained in:
Matthias Beyer 2015-12-04 13:12:42 +01:00
parent 3a76c05317
commit b6c1a6301f

View file

@ -111,7 +111,10 @@ impl<HP> Parser<HP> where
if divided.is_err() {
debug!("Error reading into internal datastructure");
return Err(divided.err().unwrap());
let mut p = ParserError::new("Dividing text failed",
s, 0,
"Dividing text with divide_text() failed");
return Err(p.with_cause(Box::new(divided.err().unwrap())));
}
let (header, data) = divided.ok().unwrap();