oxidecomputer / oxidecomputer/hubris
Audit `From<Error> for ResponseCode`
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 3.6k
- Forks
- 239
- Avg merge
- 1d 12h
- Merged PRs (30d)
- 23
Description
task-validate requires the driver-specific error type to implement From<Error> for ResponseCode.
This is awkward in cases where the driver-specific error type includes variants that aren't ResponseCode-flavored. Some drivers panic in the From implementation; others return BadResponse.
We should probably switch this to TryFrom; then, we could catch the error case in one place (i.e. in the task-validate implementation) and have a consistent behavior.
Contributor guide
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 by locating task-validate and the driver-specific From for ResponseCode implementations. Review how each driver handles error variants that are not ResponseCode-flavored, then trace the validation path where failures should be handled consistently. Done means the conversion behavior is consistent across drivers and task-validate handles conversion errors in one place.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- embedded-iot
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100