summaryrefslogtreecommitdiff
path: root/dns
diff options
context:
space:
mode:
authorJakob Schlyter <jakob@kirei.se>2022-02-19 15:20:32 +0100
committerJakob Schlyter <jakob@kirei.se>2022-02-19 15:20:32 +0100
commitc5bcc140ff9496cbe6733fdc65dd034e074b1b13 (patch)
tree7d56eb6ae6a1ed2cd613b425377cd29a0b02c33e /dns
parentc9f4be6cc915dc7e83c610409bafb58f05a9d3c6 (diff)
downloaddnspython-c5bcc140ff9496cbe6733fdc65dd034e074b1b13.tar.gz
raise NoSOA if there is no SOA record
Diffstat (limited to 'dns')
-rw-r--r--dns/zone.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/dns/zone.py b/dns/zone.py
index c126f5c..e9a82d2 100644
--- a/dns/zone.py
+++ b/dns/zone.py
@@ -716,7 +716,7 @@ class Zone(dns.transaction.TransactionManager):
def get_soa(self):
"""Get the zone SOA RR.
- Raises ``KeyError`` if there is no SOA record.
+ Raises ``dns.zone.NoSOA`` if there is no SOA RRset.
Returns a ``dns.node.Node``.
"""
@@ -726,7 +726,7 @@ class Zone(dns.transaction.TransactionManager):
origin_name = self.origin
soa = self.get_rdataset(origin_name, dns.rdatatype.SOA)
if soa is None:
- raise KeyError
+ raise NoSOA
return soa[0]
def _compute_digest(self, hash_algorithm, scheme=DigestScheme.SIMPLE):