1
0
mirror of https://github.com/github/octodns.git synced 2024-05-11 05:55:00 +00:00

WIP breakup of octodns.record file

This commit is contained in:
Ross McFarland
2023-01-02 10:12:59 -05:00
parent c9a57bf0a3
commit be7c3d279e
12 changed files with 1185 additions and 1082 deletions

View File

@@ -0,0 +1,21 @@
#
#
#
from ..idna import idna_decode
class RecordException(Exception):
pass
class ValidationError(RecordException):
@classmethod
def build_message(cls, fqdn, reasons):
reasons = '\n - '.join(reasons)
return f'Invalid record {idna_decode(fqdn)}\n - {reasons}'
def __init__(self, fqdn, reasons):
super().__init__(self.build_message(fqdn, reasons))
self.fqdn = fqdn
self.reasons = reasons