Skip to content

Commit

Permalink
make error message kindness
Browse files Browse the repository at this point in the history
  • Loading branch information
theoremoon committed Nov 28, 2019
1 parent 40e0b76 commit 77965a9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion cmd/bgproxy/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,10 @@ func (t *target) Check() error {
var r *http.Response
var err error
if t.Url.Scheme == "unix" {
// unix socket forms unix:<socket path>:<url path>
path := strings.SplitN(t.Url.Path, ":", 2)
if len(path) == 0 {
return fmt.Errorf("Invalid url format: %s", t.Url.String())
return fmt.Errorf("Invalid url format: %s (unix domain address should be formed: unix:<socket>:<url path>)", t.Url.String())
}
r, err = httpc.Get("http://unix/" + path[1])
} else {
Expand Down

0 comments on commit 77965a9

Please sign in to comment.