rust-embedded / rust-embedded/svd
Better error handling
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 84
- Forks
- 64
- PR merge metrics
- No merged PRs in 30d
Description
See related issue japaric/svd2rust#51
svd-parser uses Option<String> for ElementExt::get_child_text, and an expect is done with the defined try! macro in lib.rs, avoiding any way of knowing what had gone wrong. I propose for svd-parser to use error-chain to fix this problem, but also to use a logging crate to make debugging svd errors easier for the user without having to use utilities like SVDConv.exe to check for errors in the svd file and to see if the error is by missing implementation in svd2rust.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the related issue japaric/svd2rust#51 and inspect lib.rs, especially ElementExt::get_child_text and the try! usage described here. Determine the intended error propagation and logging scope; the work is done when SVD parsing failures expose useful causes and debugging information instead of an unexplained expect failure.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100