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: handle unknown AuthenticationStatus::Unauthenticated status #56

Merged
merged 5 commits into from
Oct 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ authors = ["[email protected]>"]
edition = "2021"
name = "azure-iot-sdk"
repository = "[email protected]:omnect/azure-iot-sdk.git"
version = "0.13.3"
version = "0.13.4"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

Expand Down
9 changes: 7 additions & 2 deletions src/client/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,8 @@ pub enum UnauthenticatedReason {
NoNetwork,
/// other communication error
CommunicationError,
/// unknown
Unknown,
}

/// Authentication status as a result of establishing a connection
Expand Down Expand Up @@ -1173,7 +1175,10 @@ impl IotHubClient {
}
_ => {
error!("unknown unauthenticated reason");
return;

AuthenticationStatus::Unauthenticated(
UnauthenticatedReason::Unknown,
)
}
}
}
Expand Down Expand Up @@ -1294,7 +1299,7 @@ impl IotHubClient {
let result = Box::from_raw(context as *mut oneshot::Sender<bool>);

if result.send(status_code == 204).is_err() {
error!("c_reported_twin_callback: cannot send confirmation result since receiver already timed out and dropped ");
error!("c_reported_twin_callback: cannot send confirmation result {status_code} since receiver already timed out and dropped ");
}
}

Expand Down
Loading