yarpc-go
yarpc-go copied to clipboard
tchannel: map all yarpcerrors codes
Today, if someone uses yarpcerrors
with the tchannel transport (e.g. in a middleware) many error types get mapped to tchannel's unexpected-error
error code. Systems assume that unexpected-error
indicates a server error, so this causes inaccuracies in metrics, logging, SLA reporting, etc.
This PR maps all yarpcerrors
codes to a corresponding tchannel error code. Most of the missing ones were client errors, so in most cases the closest tchannel error code was ErrCodeBadRequest
.
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.
Looks good to me. I agree YARPC should support all the error codes for all the protocols.
YARPC codes are described in yarpcerrors/codes.go.