Skip to content

azure_core::error::Error for azure_iot_hub #801

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

Merged
merged 6 commits into from
Jun 14, 2022

Conversation

ctaggart
Copy link
Contributor

@ctaggart ctaggart commented Jun 14, 2022

For #771

Copy link
Contributor

@johnbatty johnbatty left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@@ -116,10 +90,14 @@ impl ServiceClient {
iot_hub_name, &expiry_date_seconds
);

let key = decode(private_key).map_err(GenerateSasTokenError::DecodePrivateKeyError)?;
let key = decode(private_key).with_context(ErrorKind::Other, || {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be appropriate for errors relating to the construction of a SAS token to be ErrorKind::Credential instead of ErrorKind::Other?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably. May be. I'm not sure. ErrorKinds may take another pass or two.

@cataggar cataggar merged commit fd7edbd into Azure:main Jun 14, 2022
@ctaggart ctaggart deleted the iot_hub_error branch June 16, 2022 00:06
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.

4 participants