Let's say I am working in ServiceA
which calls ServiceB
. Now if ServiceB
returns NotFound, AlreadyExists or InvalidArgument error codes, what should we return to the caller of ServiceA
?
Based on documentation to gRPC error code, it looks like
Internal
is what we should return ifinvariants expected by the underlying system have been broken
I am not very sure what this bold text means, does it mean any downstream error should be returned as
Internal
error code?For example,
NotFound
documentation says:NotFound means some requested entity (e.g., file or directory) was not found
Does that mean we should parse the downstream error and return
NotFound
to the caller ofServiceA
ifServiceB
returnsNotFound
?