summaryrefslogtreecommitdiff
path: root/modules/caddyhttp/caddyhttp.go
diff options
context:
space:
mode:
authorMatthew Holt <mholt@users.noreply.github.com>2019-07-07 14:12:22 -0600
committerMatthew Holt <mholt@users.noreply.github.com>2019-07-07 14:12:22 -0600
commit42acdad9e541192185fe2ce64e72430ab032ca16 (patch)
tree01a810e4e60b5d66acd9f967536f094824ceec16 /modules/caddyhttp/caddyhttp.go
parent84f9f7cd606146f1a1d6717d369fc98509365de6 (diff)
Fix error handling with Validate when loading modules (fixes #2658)
The return statement was improperly nested in context.go
Diffstat (limited to 'modules/caddyhttp/caddyhttp.go')
-rw-r--r--modules/caddyhttp/caddyhttp.go10
1 files changed, 7 insertions, 3 deletions
diff --git a/modules/caddyhttp/caddyhttp.go b/modules/caddyhttp/caddyhttp.go
index 7d30178..3277e42 100644
--- a/modules/caddyhttp/caddyhttp.go
+++ b/modules/caddyhttp/caddyhttp.go
@@ -102,7 +102,7 @@ func (app *App) Validate() error {
}
for _, a := range expanded {
if sn, ok := lnAddrs[netw+a]; ok {
- return fmt.Errorf("listener address repeated: %s (already claimed by server '%s')", a, sn)
+ return fmt.Errorf("server %s: listener address repeated: %s (already claimed by server '%s')", srvName, a, sn)
}
lnAddrs[netw+a] = srvName
}
@@ -486,5 +486,9 @@ const (
DefaultHTTPSPort = 443
)
-// Interface guard
-var _ caddy.App = (*App)(nil)
+// Interface guards
+var (
+ _ caddy.App = (*App)(nil)
+ _ caddy.Provisioner = (*App)(nil)
+ _ caddy.Validator = (*App)(nil)
+)