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
|
|
@ -209,7 +209,10 @@ pub struct Jingle {
|
|||
}
|
||||
|
||||
pub fn parse_jingle(root: &Element) -> Result<Jingle, Error> {
|
||||
assert!(root.is("jingle", JINGLE_NS));
|
||||
if !root.is("jingle", JINGLE_NS) {
|
||||
return Err(Error::ParseError("This is not a Jingle element.")),
|
||||
}
|
||||
|
||||
let mut contents: Vec<Content> = vec!();
|
||||
|
||||
let action = root.attr("action")
|
||||
|
|
|
|||
Loading…
Reference in a new issue