package urlutil

import (
	"errors"
	"io"
	"net/http"
	"net/url"
	"os"
)

func open(rawurl string) (io.ReadCloser, error) {
	u, err := url.Parse(rawurl)
	if err != nil {
		return nil, err
	}
	if u.Scheme == "file" {
		return os.Open(u.Path)
	}
	if u.Scheme == "http" || u.Scheme == "https" {
		resp, err := http.Get(rawurl)
		if err != nil {
			return nil,
				errors.New("error getting: " + rawurl + ": " + err.Error())
		}
		if resp.StatusCode != http.StatusOK {
			return nil,
				errors.New("error getting: " + rawurl + ": " + resp.Status)
		}
		return resp.Body, nil
	}
	return nil, errors.New("unknown scheme: " + u.Scheme)
}

package urlutil

import (
	"errors"
	"io"
	"net/http"
	"net/url"
	"os"
)

func open(rawurl string) (io.ReadCloser, error) {
	u, err := url.Parse(rawurl)
	if err != nil {
		return nil, err
	}
	if u.Scheme == "file" {
		return os.Open(u.Path)
	}
	if u.Scheme == "http" || u.Scheme == "https" {
		resp, err := http.Get(rawurl)
		if err != nil {
			return nil, err
		}
		if resp.StatusCode != http.StatusOK {
			return nil, errors.New(resp.Status)
		}
		return resp.Body, nil
	}
	return nil, errors.New("unknown scheme: " + u.Scheme)
}

--- 
+++ 
@@ -19,10 +19,12 @@
 	if u.Scheme == "http" || u.Scheme == "https" {
 		resp, err := http.Get(rawurl)
 		if err != nil {
-			return nil, err
+			return nil,
+				errors.New("error getting: " + rawurl + ": " + err.Error())
 		}
 		if resp.StatusCode != http.StatusOK {
-			return nil, errors.New(resp.Status)
+			return nil,
+				errors.New("error getting: " + rawurl + ": " + resp.Status)
 		}
 		return resp.Body, nil
 	}
Improve error messages in lib/url/urlutil.Open().
