Merge pull request #44679 from thaJeztah/23.0_backport_errdefs_improve_debug_logs
[23.0 backport] errdefs: FromStatusCode() don't log "FIXME" debug message
This commit is contained in:
commit
cba986b340
1 changed files with 1 additions and 8 deletions
|
@ -2,14 +2,12 @@ package errdefs // import "github.com/docker/docker/errdefs"
|
|||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"github.com/sirupsen/logrus"
|
||||
)
|
||||
|
||||
// FromStatusCode creates an errdef error, based on the provided HTTP status-code
|
||||
func FromStatusCode(err error, statusCode int) error {
|
||||
if err == nil {
|
||||
return err
|
||||
return nil
|
||||
}
|
||||
switch statusCode {
|
||||
case http.StatusNotFound:
|
||||
|
@ -33,11 +31,6 @@ func FromStatusCode(err error, statusCode int) error {
|
|||
err = System(err)
|
||||
}
|
||||
default:
|
||||
logrus.WithError(err).WithFields(logrus.Fields{
|
||||
"module": "api",
|
||||
"status_code": statusCode,
|
||||
}).Debug("FIXME: Got an status-code for which error does not match any expected type!!!")
|
||||
|
||||
switch {
|
||||
case statusCode >= 200 && statusCode < 400:
|
||||
// it's a client error
|
||||
|
|
Loading…
Reference in a new issue