mirror of
https://github.com/caddyserver/caddy.git
synced 2025-01-06 22:40:31 -05:00
Report errors when loading Caddyfile
This commit is contained in:
parent
c5aa5843d9
commit
c5524b0bab
1 changed files with 5 additions and 4 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue