Skip to content

Commit

Permalink
Minor changes to info and error messages for subscribe & provide_actu…
Browse files Browse the repository at this point in the history
…ation (#117)

* Rename info message if provider is gone

* Rename info message if provider is gone II

* Make error message more detailed vor Invalid Input for subscription

* Formatting
  • Loading branch information
lukasmittag authored Dec 11, 2024
1 parent 0af4e2c commit 2159d18
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions databroker/src/broker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -822,10 +822,10 @@ impl Subscriptions {

self.actuation_subscriptions.retain(|sub| {
if !sub.actuation_provider.is_available() {
info!("Provider gone: removing subscription");
info!("Provider gone: removing provided actuation");
false
} else if sub.permissions.is_expired() {
info!("Permissions of Provider expired: removing subscription");
info!("Permissions of Provider expired: removing provided actuation");
false
} else {
true
Expand Down
2 changes: 1 addition & 1 deletion databroker/src/grpc/kuksa_val_v1/val.rs
Original file line number Diff line number Diff line change
Expand Up @@ -610,7 +610,7 @@ impl proto::val_server::Val for broker::DataBroker {
}
Err(SubscriptionError::InvalidInput) => Err(tonic::Status::new(
tonic::Code::InvalidArgument,
"Invalid Argument",
"No valid path specified",
)),
Err(SubscriptionError::InternalError) => {
Err(tonic::Status::new(tonic::Code::Internal, "Internal Error"))
Expand Down
8 changes: 4 additions & 4 deletions databroker/src/grpc/kuksa_val_v2/val.rs
Original file line number Diff line number Diff line change
Expand Up @@ -256,9 +256,9 @@ impl proto::val_server::Val for broker::DataBroker {
Ok(tonic::Response::new(Box::pin(stream)))
}
Err(SubscriptionError::NotFound) => Err(tonic::Status::not_found("Path not found")),
Err(SubscriptionError::InvalidInput) => {
Err(tonic::Status::invalid_argument("Invalid Argument"))
}
Err(SubscriptionError::InvalidInput) => Err(tonic::Status::invalid_argument(
"No valid id or path specified",
)),
Err(SubscriptionError::InternalError) => Err(tonic::Status::internal("Internal Error")),
Err(SubscriptionError::InvalidBufferSize) => Err(tonic::Status::new(
tonic::Code::InvalidArgument,
Expand Down Expand Up @@ -333,7 +333,7 @@ impl proto::val_server::Val for broker::DataBroker {
}
Err(SubscriptionError::InvalidInput) => Err(tonic::Status::new(
tonic::Code::InvalidArgument,
"Invalid Argument",
"No valid id or path specified",
)),
Err(SubscriptionError::InternalError) => {
Err(tonic::Status::new(tonic::Code::Internal, "Internal Error"))
Expand Down

0 comments on commit 2159d18

Please sign in to comment.