mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
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>
This commit is contained in:
parent
6359da4afa
commit
32f4fdfb5c
1 changed files with 0 additions and 7 deletions
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue