diff options
author | Sebastiaan van Stijn <github@gone.nl> | 2019-07-15 17:09:20 +0200 |
---|---|---|
committer | Sebastiaan van Stijn <github@gone.nl> | 2019-07-15 18:22:19 +0200 |
commit | 32f4fdfb5c8846922302c20fdcab973227eb9bd6 (patch) | |
tree | 17d4269ad08661accc29b56f60e1ac2b433a8ffe /errdefs | |
parent | 6359da4afa34dbfa1d28eca51875e58ca19df9ec (diff) | |
download | docker-32f4fdfb5c8846922302c20fdcab973227eb9bd6.tar.gz |
errdefs: remove unneeded recursive calls
The `statusCodeFromGRPCError` and `statusCodeFromDistributionError`
helpers are used by `GetHTTPErrorStatusCode`, which already recurses
if the error implements the `Causer` interface.
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Diffstat (limited to 'errdefs')
-rw-r--r-- | errdefs/http_helpers.go | 7 |
1 files changed, 0 insertions, 7 deletions
diff --git a/errdefs/http_helpers.go b/errdefs/http_helpers.go index ac9bf6d33e..faebc6a6d3 100644 --- a/errdefs/http_helpers.go +++ b/errdefs/http_helpers.go @@ -136,9 +136,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) @@ -163,10 +160,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 } |