diff options
author | Matthew Holt <[email protected]> | 2016-08-17 17:02:01 -0600 |
---|---|---|
committer | Matthew Holt <[email protected]> | 2016-08-17 17:02:01 -0600 |
commit | c5524b0babddb1ee2ac22293c24a00e0ddb8011e (patch) | |
tree | c68064db6da4f4c8f2d6cce406dfa026e6274ad4 | |
parent | c5aa5843d92a27eaf521e28684111030135d9cdc (diff) | |
download | caddy-c5524b0babddb1ee2ac22293c24a00e0ddb8011e.tar.gz caddy-c5524b0babddb1ee2ac22293c24a00e0ddb8011e.zip |
Report errors when loading Caddyfile
-rw-r--r-- | plugins.go | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/plugins.go b/plugins.go index 022674720..5134aa910 100644 --- a/plugins.go +++ b/plugins.go @@ -271,13 +271,14 @@ func loadCaddyfileInput(serverType string) (Input, error) { var loadedBy string var caddyfileToUse Input for _, l := range caddyfileLoaders { - if cdyfile, err := l.loader.Load(serverType); cdyfile != nil { + cdyfile, err := l.loader.Load(serverType) + if err != nil { + return nil, fmt.Errorf("loading Caddyfile via %s: %v", l.name, err) + } + if cdyfile != nil { if caddyfileToUse != nil { return nil, fmt.Errorf("Caddyfile loaded multiple times; first by %s, then by %s", loadedBy, l.name) } - if err != nil { - return nil, err - } loaderUsed = l caddyfileToUse = cdyfile loadedBy = l.name |