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

Fix #69: Do not unwrap when extracting data from responses #72

Conversation

msirringhaus
Copy link
Collaborator

There still are a bunch of other unwraps in the code (some of which you can even see in this patch), mostly parsing either CBOR or other binary stuff in the crypto-section.

Not sure, if we want to address them here as well, and if so, how.
For CBOR-related things, we could basically also just return the serde errors?

@AlfioEmanueleFresta
Copy link
Member

For CBOR-related things, we could basically also just return the serde errors?

I'm not sure the serde errors will be useful to the caller. IMO, the smaller/simpler the error enum, the more likely it is to be handled correctly by clients.

We could log these errors and return InvalidDeviceResponse?

@AlfioEmanueleFresta AlfioEmanueleFresta added the enhancement New feature or request label Feb 15, 2025
@msirringhaus
Copy link
Collaborator Author

Added a similar macro for CBOR parsing now.
There are still a bunch of other unwraps in the code, but I think those should be addressed by another PR. They seem less likely to be triggered any time soon.

@AlfioEmanueleFresta AlfioEmanueleFresta merged commit 6b62408 into linux-credentials:master Feb 17, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants