Skip to content

Commit 91f07af

Browse files
committed
Added error checking
Closes rust-embedded#18
1 parent 173be38 commit 91f07af

File tree

5 files changed

+494
-229
lines changed

5 files changed

+494
-229
lines changed

Cargo.toml

+1
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,4 @@ version = "0.5.1"
1010

1111
[dependencies]
1212
xmltree = "0.3.2"
13+
error-chain = "0.10.0"

generate-tests.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ EOF
4949
fn $device() {
5050
let xml = include_str!(concat!(env!("CARGO_MANIFEST_DIR"), "/$device_path"));
5151
52-
svd::parse(xml);
52+
svd::parse(xml).unwrap();
5353
}
5454
EOF
5555
done

src/errors.rs

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
use xmltree;
2+
use std::str;
3+
use std::num;
4+
error_chain! {
5+
foreign_links {
6+
XmlParseError(xmltree::ParseError);
7+
StrParseBoolError(str::ParseBoolError);
8+
NumParseIntError(num::ParseIntError);
9+
10+
}
11+
}

0 commit comments

Comments
 (0)