log error message when receiving an unexpected type error

Signed-off-by: tonic <tonicbupt@gmail.com>
(cherry picked from commit 24aaa7f8c9)
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
This commit is contained in:
tonic 2021-11-07 23:12:30 +08:00 committed by Davanum Srinivas
parent 906f57ff5b
commit 3bd611d7a5
No known key found for this signature in database
GPG Key ID: 80D83A796103BF59
1 changed files with 3 additions and 3 deletions

View File

@ -100,10 +100,10 @@ func FromStatusCode(err error, statusCode int) error {
err = System(err)
}
default:
logrus.WithFields(logrus.Fields{
logrus.WithError(err).WithFields(logrus.Fields{
"module": "api",
"status_code": fmt.Sprintf("%d", statusCode),
}).Debugf("FIXME: Got an status-code for which error does not match any expected type!!!: %d", statusCode)
"status_code": statusCode,
}).Debug("FIXME: Got an status-code for which error does not match any expected type!!!")
switch {
case statusCode >= 200 && statusCode < 400: