From 0dbd56887c08645e5c0830a2e6bd831822728423 Mon Sep 17 00:00:00 2001 From: Julius Foitzik Date: Mon, 29 Jun 2020 17:08:05 +0200 Subject: [PATCH] Return on error when RoundTrip()'ing --- http/transport/dump_round_tripper.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/http/transport/dump_round_tripper.go b/http/transport/dump_round_tripper.go index 0978c3f51..3025eeb04 100644 --- a/http/transport/dump_round_tripper.go +++ b/http/transport/dump_round_tripper.go @@ -111,7 +111,9 @@ func (l *DumpRoundTripper) RoundTrip(req *http.Request) (*http.Response, error) } resp, err := l.Transport().RoundTrip(req) - + if err != nil { + return resp, err + } // response logging if l.DumpResponse || l.DumpResponseHEX { respDump, err := httputil.DumpResponse(resp, l.DumpBody)