From 5f7e6eadaed64501411ee55ff7dbcc8c51e1e25e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Zamanillo?= Date: Sat, 5 Sep 2020 14:46:24 +0200 Subject: [PATCH] Do not wrap errors It makes the warning message unreadable e.j: "Could not execute step: could not handle http request: Could not do request: ERR" --- pkg/executer/executer_http.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkg/executer/executer_http.go b/pkg/executer/executer_http.go index a4008f5b..0a93e68b 100644 --- a/pkg/executer/executer_http.go +++ b/pkg/executer/executer_http.go @@ -141,7 +141,7 @@ func (e *HTTPExecuter) ExecuteHTTP(ctx context.Context, p progress.IProgress, re for e.bulkHTTPRequest.Next(reqURL) && !result.Done { httpRequest, err := e.bulkHTTPRequest.MakeHTTPRequest(ctx, reqURL, dynamicvalues, e.bulkHTTPRequest.Current(reqURL)) if err != nil { - result.Error = errors.Wrap(err, "could not build http request") + result.Error = err p.Drop(remaining) @@ -150,7 +150,7 @@ func (e *HTTPExecuter) ExecuteHTTP(ctx context.Context, p progress.IProgress, re err = e.handleHTTP(reqURL, httpRequest, dynamicvalues, &result) if err != nil { - result.Error = errors.Wrap(err, "could not handle http request") + result.Error = err p.Drop(remaining) @@ -174,7 +174,7 @@ func (e *HTTPExecuter) handleHTTP(reqURL string, request *requests.HTTPRequest, if e.debug { dumpedRequest, err := httputil.DumpRequest(req.Request, true) if err != nil { - return errors.Wrap(err, "could not make http request") + return err } gologger.Infof("Dumped HTTP request for %s (%s)\n\n", reqURL, e.template.ID) @@ -188,7 +188,7 @@ func (e *HTTPExecuter) handleHTTP(reqURL string, request *requests.HTTPRequest, resp.Body.Close() } - return errors.Wrap(err, "Could not do request") + return err } if e.debug {