Skip to content
This repository has been archived by the owner on Feb 27, 2024. It is now read-only.

Fix sas token #21

Closed
wants to merge 2 commits into from
Closed

Fix sas token #21

wants to merge 2 commits into from

Conversation

JoergZeidler
Copy link
Contributor

@JanZachmann : did not found a way to handle that condition with just and "if" condition. seems still open in rust? rust-lang/rfcs#2616

Comment on lines +33 to +43
if let UnauthenticatedReason::ExpiredSasToken = reason {
info!("SAS Token expired, SDK will try to refresh the token automatically");
}
else {
client.stop().await.unwrap();
return Err(IotError::from(format!(
"No connection. Reason: {:?}",
reason
)));
}

Copy link
Contributor

Choose a reason for hiding this comment

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

You can better write the following code. We don't need another log since it is logged already in SDK code

                if !matches!(reason, UnauthenticatedReason::ExpiredSasToken) {
                    client.stop().await.unwrap();
                    return Err(IotError::from(format!(
                        "No connection. Reason: {:?}",
                        reason
                    )));
                }

@JanZachmann
Copy link
Contributor

@JoergZeidler you can use my PR if you don't want to update yours:
#23

@JoergZeidler JoergZeidler deleted the fix_sas_token branch July 22, 2022 07:43
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants