Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve SPI error messages when using embedded_hal #140

Merged
merged 1 commit into from
Apr 9, 2024
Merged

Improve SPI error messages when using embedded_hal #140

merged 1 commit into from
Apr 9, 2024

Conversation

andber1
Copy link
Contributor

@andber1 andber1 commented Mar 18, 2024

I removed the error conversions to an Error::Io. Is there a reason for this?
This way you get more useful error messages. For example

called `Result::unwrap()` on an `Err` value: Io(Os { code: 90, kind: Uncategorized, message: "Message too long" })

instead of

called `Result::unwrap()` on an `Err` value: Io(Custom { kind: Other, error: "SimpleHalSpiDevice write transaction error" })

@golemparts
Copy link
Owner

While I'm not sure what the reasoning was for the conversions, I agree that the original error messages provide more useful information. I'll merge this in, unless someone has a specific reason to keep the error mapping.

@golemparts golemparts merged commit f726d01 into golemparts:master Apr 9, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants