Skip to content

Commit e0408d5

Browse files
committed
debuging
1 parent 4fc63a8 commit e0408d5

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

response/success.go

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ func HandleAPISuccessResponse(resp *http.Response, out interface{}, sugar *zap.S
3939
}
4040

4141
// TODO do we need to redact some auth headers here? I think so.
42-
sugar.Debug("HTTP Response Headers", zap.Any("Headers", resp.Header))
43-
sugar.Debug("Raw HTTP Response", zap.String("Body", string(bodyBytes)))
42+
sugar.Debugw("HTTP Response Headers", zap.Any("Headers", resp.Header))
43+
sugar.Debugw("Raw HTTP Response", zap.String("Body", string(bodyBytes)))
4444

4545
bodyReader := bytes.NewReader(bodyBytes)
4646
contentType := resp.Header.Get("Content-Type")
@@ -49,7 +49,9 @@ func HandleAPISuccessResponse(resp *http.Response, out interface{}, sugar *zap.S
4949
var handler contentHandler
5050
var ok bool
5151

52-
sugar.Debugw("things", "LOGHERE")
52+
sugar.Debug("LOGHERE-HandleApiSuccessResponse")
53+
sugar.Debugw("Headers:", "content-type", contentType, "content-disposition", contentDisposition)
54+
5355
if handler, ok = responseUnmarshallers[contentType]; ok {
5456
return handler(bodyReader, out, sugar, contentType)
5557
}
@@ -59,7 +61,7 @@ func HandleAPISuccessResponse(resp *http.Response, out interface{}, sugar *zap.S
5961
}
6062

6163
errMsg := fmt.Sprintf("unexpected MIME type: %s", contentType)
62-
sugar.Error("Unmarshal error", zap.String("content type", contentType), zap.Error(errors.New(errMsg)))
64+
sugar.Errorw("Unmarshal error", zap.String("content type", contentType), zap.Error(errors.New(errMsg)))
6365
return errors.New(errMsg)
6466

6567
}

0 commit comments

Comments
 (0)