You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
All rpc api method calls started by clients return a status code and optional message.
I think that adding a status explicitly in responses is redundant and def not idiomatic grpc pattern.
e.g.:
There are several other responses such as this in the smesher service.
So a method that just returns a status in its response should use the build-in status and status code.
See: https://grpc.io/docs/guides/error/
So a method that completes without an error and has not data to return such as StopSmeshingResponse should return status == 0 when there's no error or otherwise return one of the pre-defined error statuses and a message as defined here: https://grpc.github.io/grpc/core/md_doc_statuscodes.html - or an un-reserved code with message when one of the reserved error codes is not applicable.
So, StopSmeshingResponse should be defined like this:
messageStopSmeshingResponse {
}
The following status codes are never generated by the library and can be used:
INVALID_ARGUMENT
NOT_FOUND
ALREADY_EXISTS
FAILED_PRECONDITION
ABORTED
OUT_OF_RANGE
DATA_LOSS
The text was updated successfully, but these errors were encountered:
avive
changed the title
Don't return grpc status as repsonse members
Don't return rpc.Status as an explicit response data items
Jun 1, 2021
avive
changed the title
Don't return rpc.Status as an explicit response data items
Don't return rpc.Status as an explicit response data item
Jun 1, 2021
All rpc api method calls started by clients return a status code and optional message.
I think that adding a status explicitly in responses is redundant and def not idiomatic grpc pattern.
e.g.:
There are several other responses such as this in the smesher service.
So a method that just returns a status in its response should use the build-in status and status code.
See: https://grpc.io/docs/guides/error/
So a method that completes without an error and has not data to return such as StopSmeshingResponse should return status == 0 when there's no error or otherwise return one of the pre-defined error statuses and a message as defined here: https://grpc.github.io/grpc/core/md_doc_statuscodes.html - or an un-reserved code with message when one of the reserved error codes is not applicable.
@lrettig - please review.
So, StopSmeshingResponse should be defined like this:
The following status codes are never generated by the library and can be used:
The text was updated successfully, but these errors were encountered: