Replace assert!()s with proper errors in parsers.
This commit is contained in:
parent
6a0724d133
commit
fc7a0517d3
8 changed files with 23 additions and 8 deletions
|
|
@ -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."))
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue