Skip to content

Commit

Permalink
Error fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
rafaeling committed Oct 28, 2024
1 parent a3005b6 commit 7a0d4ac
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 17 deletions.
2 changes: 1 addition & 1 deletion databroker/src/grpc/kuksa_val_v2/conversions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,7 @@ impl broker::UpdateError {
format!("Value out of bounds (id: {})", id),
),
broker::UpdateError::UnsupportedType => tonic::Status::new(
tonic::Code::Unimplemented,
tonic::Code::InvalidArgument,
format!("Unsupported type (id: {})", id),
),
broker::UpdateError::PermissionDenied => tonic::Status::new(
Expand Down
9 changes: 4 additions & 5 deletions databroker/src/grpc/kuksa_val_v2/val.rs
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ impl proto::val_server::Val for broker::DataBroker {
// PERMISSION_DENIED if access is denied for the actuator.
// UNAUTHENTICATED if no credentials provided or credentials has expired
// UNAVAILABLE if there is no provider currently providing the actuator
// OUT_OF_RANGE is the provided value is out of the min/max range specified
// OUT_OF_RANGE if the provided value is out of the min/max range specified
// DATA_LOSS is there is a internal TransmissionFailure
// INVALID_ARGUMENT
// - if the data type used in the request does not match
Expand Down Expand Up @@ -402,7 +402,7 @@ impl proto::val_server::Val for broker::DataBroker {
// PERMISSION_DENIED if access is denied for any of the actuators.
// UNAUTHENTICATED if no credentials provided or credentials has expired
// UNAVAILABLE if there is no provider currently providing an actuator
// OUT_OF_RANGE is the provided value is out of the min/max range specified
// OUT_OF_RANGE if the provided value is out of the min/max range specified
// DATA_LOSS is there is a internal TransmissionFailure
// INVALID_ARGUMENT
// - if the data type used in the request does not match
Expand Down Expand Up @@ -514,7 +514,7 @@ impl proto::val_server::Val for broker::DataBroker {
// PERMISSION_DENIED
// - if access is denied for any of the signals.
// UNAUTHENTICATED if no credentials provided or credentials has expired
// OUT_OF_RANGE is the provider is out of the min/max range specified
// OUT_OF_RANGE if the published value is out of the min/max range specified
// INVALID_ARGUMENT
// - if the data type used in the request does not match
// the data type of the addressed signal
Expand Down Expand Up @@ -585,15 +585,14 @@ impl proto::val_server::Val for broker::DataBroker {
// PERMISSION_DENIED if access is denied for any of the signals.
// UNAUTHENTICATED if no credentials provided or credentials has expired
// ALREADY_EXISTS if a provider already claimed the ownership of an actuator
// UNAUTHENTICATED if permission expired
//
// - Provider sends PublishValuesRequest -> Databroker returns PublishValuesResponse
// GRPC errors are returned as messages in the stream
// response with the signal id `map<int32, Error> status = 2;` (permissive case)
// NOT_FOUND if a signal is non-existant.
// PERMISSION_DENIED
// - if access is denied for a signal.
// OUT_OF_RANGE is the provider is out of the min/max range specified
// OUT_OF_RANGE if the published value is out of the min/max range specified
// INVALID_ARGUMENT
// - if the data type used in the request does not match
// the data type of the addressed signal
Expand Down
21 changes: 10 additions & 11 deletions proto/kuksa/val/v2/val.proto
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@ service VAL {
// PERMISSION_DENIED if access is denied for any of the signals.
// INVALID_ARGUMENT if the request is empty or provided path is too long
//
// When subscribing the Broker shall immediately return the value for all
// subscribed entries. If no value is available when subscribing a DataPoint
// with value None shall be returned.
// When subscribing, Databroker shall immediately return the value for all
// subscribed entries.
// If a value isn't available when subscribing to a Datapoint, it should return None
//
rpc Subscribe(SubscribeRequest) returns (stream SubscribeResponse);

Expand All @@ -62,9 +62,9 @@ service VAL {
// PERMISSION_DENIED if access is denied for any of the signals.
// INVALID_ARGUMENT if the request is empty
//
// When subscribing the Broker shall immediately return the value for all
// subscribed entries. If no value is available when subscribing a DataPoint
// with value None shall be returned.
// When subscribing, Databroker shall immediately return the value for all
// subscribed entries.
// If a value isn't available when subscribing to a Datapoint, it should return None
//
rpc SubscribeById(SubscribeByIdRequest) returns (stream SubscribeByIdResponse);

Expand All @@ -75,7 +75,7 @@ service VAL {
// PERMISSION_DENIED if access is denied for the actuator.
// UNAUTHENTICATED if no credentials provided or credentials has expired
// UNAVAILABLE if there is no provider currently providing the actuator
// OUT_OF_RANGE is the provided value is out of the min/max range specified
// OUT_OF_RANGE if the provided value is out of the min/max range specified
// DATA_LOSS is there is a internal TransmissionFailure
// INVALID_ARGUMENT
// - if the data type used in the request does not match
Expand All @@ -94,7 +94,7 @@ service VAL {
// PERMISSION_DENIED if access is denied for any of the actuators.
// UNAUTHENTICATED if no credentials provided or credentials has expired
// UNAVAILABLE if there is no provider currently providing an actuator
// OUT_OF_RANGE is the provided value is out of the min/max range specified
// OUT_OF_RANGE if of the provided actuators values are out of the min/max range specified
// DATA_LOSS is there is a internal TransmissionFailure
// INVALID_ARGUMENT
// - if the data type used in the request does not match
Expand All @@ -120,7 +120,7 @@ service VAL {
// PERMISSION_DENIED
// - if access is denied for any of the signals.
// UNAUTHENTICATED if no credentials provided or credentials has expired
// OUT_OF_RANGE is the provider is out of the min/max range specified
// OUT_OF_RANGE if the published value is out of the min/max range specified
// INVALID_ARGUMENT
// - if the data type used in the request does not match
// the data type of the addressed signal
Expand All @@ -143,15 +143,14 @@ service VAL {
// PERMISSION_DENIED if access is denied for any of the signals.
// UNAUTHENTICATED if no credentials provided or credentials has expired
// ALREADY_EXISTS if a provider already claimed the ownership of an actuator
// UNAUTHENTICATED if permission expired
//
// - Provider sends PublishValuesRequest -> Databroker returns PublishValuesResponse
// GRPC errors are returned as messages in the stream
// response with the signal id `map<int32, Error> status = 2;` (permissive case)
// NOT_FOUND if a signal is non-existant.
// PERMISSION_DENIED
// - if access is denied for a signal.
// OUT_OF_RANGE is the provider is out of the min/max range specified
// OUT_OF_RANGE if the published value is out of the min/max range specified
// INVALID_ARGUMENT
// - if the data type used in the request does not match
// the data type of the addressed signal
Expand Down

0 comments on commit 7a0d4ac

Please sign in to comment.