Merge pull request #442 from thaJeztah/19.03_backport_errdefs_no_recurse

[19.03 backport] errdefs: remove unneeded recursive calls
This commit is contained in:
Sebastiaan van Stijn 2020-01-23 20:23:19 +01:00 committed by GitHub
commit d2693998a6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -141,9 +141,6 @@ func statusCodeFromGRPCError(err error) int {
case codes.Unavailable: // code 14
return http.StatusServiceUnavailable
default:
if e, ok := err.(causer); ok {
return statusCodeFromGRPCError(e.Cause())
}
// codes.Canceled(1)
// codes.Unknown(2)
// codes.DeadlineExceeded(4)
@ -168,10 +165,6 @@ func statusCodeFromDistributionError(err error) int {
}
case errcode.ErrorCoder:
return errs.ErrorCode().Descriptor().HTTPStatusCode
default:
if e, ok := err.(causer); ok {
return statusCodeFromDistributionError(e.Cause())
}
}
return http.StatusInternalServerError
}