浏览代码

log error message when receiving an unexpected type error

Signed-off-by: tonic <tonicbupt@gmail.com>
tonic 3 年之前
父节点
当前提交
24aaa7f8c9
共有 1 个文件被更改,包括 3 次插入3 次删除
  1. 3 3
      errdefs/http_helpers.go

+ 3 - 3
errdefs/http_helpers.go

@@ -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: