Merge pull request #42999 from tonicbupt/error-details

log error message when receiving an unexpected type error
This commit is contained in:
Tianon Gravi 2021-11-15 12:05:17 -08:00 committed by GitHub
commit 58e68789bf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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: