rust-embedded / rust-embedded/svd

Better error handling

Open
#18 5 comments 0 reactions 0 assignees View on GitHub

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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.