Replace assert!()s with proper errors in parsers.

This commit is contained in:
Emmanuel Gil Peyrot 2017-04-19 23:41:54 +01:00
commit fc7a0517d3
8 changed files with 23 additions and 8 deletions

View file

@ -31,7 +31,7 @@ pub fn parse_chatstate(root: &Element) -> Result<ChatState, Error> {
} else if root.is("paused", CHATSTATES_NS) {
Ok(ChatState::Paused)
} else {
Err(Error::ParseError("Unknown chatstate element."))
Err(Error::ParseError("This is not a chatstate element."))
}
}