Commit c5524b0b authored by Matthew Holt's avatar Matthew Holt

Report errors when loading Caddyfile

parent c5aa5843
......@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment