summaryrefslogtreecommitdiffhomepage
path: root/plugins.go
diff options
context:
space:
mode:
authorMatthew Holt <[email protected]>2016-08-17 17:02:01 -0600
committerMatthew Holt <[email protected]>2016-08-17 17:02:01 -0600
commitc5524b0babddb1ee2ac22293c24a00e0ddb8011e (patch)
treec68064db6da4f4c8f2d6cce406dfa026e6274ad4 /plugins.go
parentc5aa5843d92a27eaf521e28684111030135d9cdc (diff)
downloadcaddy-c5524b0babddb1ee2ac22293c24a00e0ddb8011e.tar.gz
caddy-c5524b0babddb1ee2ac22293c24a00e0ddb8011e.zip
Report errors when loading Caddyfile
Diffstat (limited to 'plugins.go')
-rw-r--r--plugins.go9
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