From b6c1a6301f7cc60a72e850e860681114cc90e83b Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Fri, 4 Dec 2015 13:12:42 +0100 Subject: [PATCH] Use ParserError::with_cause() and build new ParserError object --- src/storage/parser.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/storage/parser.rs b/src/storage/parser.rs index 6e010a85..9bfeb04d 100644 --- a/src/storage/parser.rs +++ b/src/storage/parser.rs @@ -111,7 +111,10 @@ impl Parser 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();