From f3e3f19cd3ac8d7910072bda89887e1d6c2d6459 Mon Sep 17 00:00:00 2001 From: Jonathan Leroy Date: Tue, 3 Nov 2020 22:59:39 +0100 Subject: [PATCH] Suppress previous exceptions before raising GandiClientUnknownDomainName exception --- octodns/provider/gandi.py | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/octodns/provider/gandi.py b/octodns/provider/gandi.py index dcc222d..84ff291 100644 --- a/octodns/provider/gandi.py +++ b/octodns/provider/gandi.py @@ -354,12 +354,16 @@ class GandiProvider(BaseProvider): self._client.zone_create(zone) self.log.info('_apply: zone has been successfully created') except GandiClientNotFound: - raise GandiClientUnknownDomainName('This domain is not ' - 'registred at Gandi. ' - 'Please register or ' - 'transfer it here ' - 'to be able to manage its ' - 'DNS zone.') + # We suppress existing exception before raising + # GandiClientUnknownDomainName. + e = GandiClientUnknownDomainName('This domain is not ' + 'registred at Gandi. ' + 'Please register or ' + 'transfer it here ' + 'to be able to manage its ' + 'DNS zone.') + e.__cause__ = None + raise e # Force records deletion to be done before creation in order to avoid # "CNAME record must be the only record" error when an existing CNAME