COVESA / COVESA/uservices

uServices error handling?

Open
#2 5 comments 0 reactions 0 assignees View on GitHub
Dominant language
No language data
Stars
13
Forks
9
PR merge metrics
No merged PRs in 30d

Description

Out of curiosity, is there a "design pattern" documentation for uServices? I notice that all RPCs return a message containing `google.rpc.Status`. But isn't `google.rpc.Status` implicitly included anyway, i.e. a server can return for instance `INVALID_ARGUMENT` (like in this [example](https://github.com/grpc/grpc/blob/master/examples/cpp/error_handling/greeter_server.cc#L57)) even if there is no explicit `google.rpc.Status` field in the return message.

Or is it so that as part of uServices/uProtocol that an explicit `google.rpc.Status` as part of the return message always is required, or at least recommended?

```
service Engine {
...

// Request to reset an engine component's life to 100%. After a reset, the
// remaining life will go back to 100% and the health state of that component
// will go back to the OK state.
rpc ResetHealth(ResetHealthRequest) returns (ResetHealthResponse) {
option (method_id) = 1;
}
}

...

// Response to reset health request
message ResetHealthResponse {
// Rpc return status
google.rpc.Status status = 1;
}
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.