diff --git a/src/netcup_dns/main.py b/src/netcup_dns/main.py index 4660a7d..75c39a7 100644 --- a/src/netcup_dns/main.py +++ b/src/netcup_dns/main.py @@ -70,7 +70,11 @@ def update_record_destination(api: Client, domain: str, hostname: str, type_: st :param destination: :return: True if `destination` differs from the old destination. """ - record = get_record(api, domain, hostname, type_) + try: + record = get_record(api, domain, hostname, type_) + except Exception as e: + raise Exception(f'Could not get DNS record for domain {domain}, hostname {hostname} and type {type_}') from e + if record.destination == destination: # The new destination is identical with the current one. # Thus, we don't need to call the api.update_dns_record() method.