mirror of
https://github.com/coredns/coredns.git
synced 2025-10-27 08:14:18 -04:00
fix: plugin/file: return error when parsing the file fails (#6699)
Signed-off-by: Lin-1997 <1204878199@qq.com>
This commit is contained in:
@@ -159,6 +159,9 @@ func Parse(f io.Reader, origin, fileName string, serial int64) (*Zone, error) {
|
||||
if !seenSOA {
|
||||
return nil, fmt.Errorf("file %q has no SOA record for origin %s", fileName, origin)
|
||||
}
|
||||
if zp.Err() != nil {
|
||||
return nil, fmt.Errorf("failed to parse file %q for origin %s with error %v", fileName, origin, zp.Err())
|
||||
}
|
||||
|
||||
return z, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user