mirror of
https://github.com/coredns/coredns.git
synced 2025-11-11 14:32:25 -05:00
Bail out on failure when starting up
Don't silently hide failures, barf on startup. Also add more integration tests that should catch some of these things.
This commit is contained in:
@@ -54,7 +54,8 @@ func fileParse(c *Controller) (file.Zones, error) {
|
||||
|
||||
reader, err := os.Open(fileName)
|
||||
if err != nil {
|
||||
continue
|
||||
// bail out
|
||||
return file.Zones{}, err
|
||||
}
|
||||
|
||||
for i, _ := range origins {
|
||||
@@ -62,6 +63,8 @@ func fileParse(c *Controller) (file.Zones, error) {
|
||||
zone, err := file.Parse(reader, origins[i], fileName)
|
||||
if err == nil {
|
||||
z[origins[i]] = zone
|
||||
} else {
|
||||
return file.Zones{}, err
|
||||
}
|
||||
names = append(names, origins[i])
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user