Skip to content

Commit f36dc6c

Browse files
committed
TUN-3540: Better copy in ingress rules error messages
1 parent 6dad2bf commit f36dc6c

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

ingress/ingress.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ import (
1717
)
1818

1919
var (
20-
ErrNoIngressRules = errors.New("No ingress rules were specified in the config file")
21-
errLastRuleNotCatchAll = errors.New("The last ingress rule must match all hostnames (i.e. it must be missing, or must be \"*\")")
20+
ErrNoIngressRules = errors.New("The config file doesn't contain any ingress rules")
21+
errLastRuleNotCatchAll = errors.New("The last ingress rule must match all URLs (i.e. it should not have a hostname or path filter)")
2222
errBadWildcard = errors.New("Hostname patterns can have at most one wildcard character (\"*\") and it can only be used for subdomains, e.g. \"*.example.com\"")
23-
errHostnameContainsPort = errors.New("Hostname cannot contain port")
23+
errHostnameContainsPort = errors.New("Hostname cannot contain a port")
2424
ErrURLIncompatibleWithIngress = errors.New("You can't set the --url flag (or $TUNNEL_URL) when using multiple-origin ingress rules")
2525
)
2626

@@ -103,7 +103,7 @@ func parseSingleOriginService(c *cli.Context, allowURLFromArgs bool) (OriginServ
103103
}
104104
return &unixSocketPath{path: path}, nil
105105
}
106-
return nil, errors.New("You must either set ingress rules in your config file, or use --url or use --unix-socket")
106+
return nil, errors.New("You must either set ingress rules in your config file, or use --url, or use --unix-socket")
107107
}
108108

109109
// IsEmpty checks if there are any ingress rules.
@@ -151,7 +151,7 @@ func validate(ingress []config.UnvalidatedIngressRule, defaults OriginRequestCon
151151
}
152152

153153
if u.Scheme == "" || u.Hostname() == "" {
154-
return Ingress{}, fmt.Errorf("The service %s must have a scheme and a hostname", r.Service)
154+
return Ingress{}, fmt.Errorf("%s is an invalid address, please make sure it has a scheme and a hostname", r.Service)
155155
}
156156

157157
if u.Path != "" {

0 commit comments

Comments
 (0)