浏览代码

Remove source from fetch error message

The source is already included in the error, so it is redundant, eg:

pprof http://nowhere.nothere
Currently produces:
http://nowhere.nothere: http fetch http://nowhere.nothere: Get http://nowhere.nothere: dial tcp: lookup nowhere.nothere: no such host

With this commit:
http://nowhere.nothere: http fetch: Get http://nowhere.nothere: dial tcp: lookup nowhere.nothere: no such host
Raul Silvera 8 年前
父节点
当前提交
9aa6971515
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1
    1
      internal/driver/fetch.go

+ 1
- 1
internal/driver/fetch.go 查看文件

@@ -388,7 +388,7 @@ func fetch(source string, duration, timeout time.Duration, ui plugin.UI) (p *pro
388 388
 func fetchURL(source string, timeout time.Duration) (io.ReadCloser, error) {
389 389
 	resp, err := httpGet(source, timeout)
390 390
 	if err != nil {
391
-		return nil, fmt.Errorf("http fetch %s: %v", source, err)
391
+		return nil, fmt.Errorf("http fetch: %v", err)
392 392
 	}
393 393
 	if resp.StatusCode != http.StatusOK {
394 394
 		return nil, fmt.Errorf("server response: %s", resp.Status)