mirror of
https://github.com/coredns/coredns.git
synced 2025-10-28 00:34:24 -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 {
|
if !seenSOA {
|
||||||
return nil, fmt.Errorf("file %q has no SOA record for origin %s", fileName, origin)
|
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
|
return z, nil
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user