Don't return Unknown error code
Since we want to have every undefined error returned as Internal
rather than Unknown
, I wonder if we should have an interceptor that converts all Unknown
error codes to Internal
. That way we wouldn't have to sprinkle helper.ErrInternal()
calls around but could focus only on annotating errors where a specific code is desired. As far as I see, there would be no semantic difference since we are guiding on blanket wrapping every error return with helper.ErrInternal
.
The other downside with having a blanket wrapping of helper.ErrInternal()
is that the context errors context.Canceled
and context.DeadlineExceeded
get coerced into an Internal
code. If we don't do this, the gRPC server will handle it correctly and report them as Canceled
and DeadlineExceeded
.