mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-07-22 02:36:02 +02:00
handling of OBJECT_EXISTS in nameserver create_host and update_host methods
This commit is contained in:
parent
918c5ef0b2
commit
662bb1a1ef
1 changed files with 12 additions and 2 deletions
|
@ -277,6 +277,11 @@ class Domain(TimeStampedModel, DomainHelper):
|
|||
return response.code
|
||||
except RegistryError as e:
|
||||
logger.error("Error _create_host, code was %s error was %s" % (e.code, e))
|
||||
# OBJECT_EXISTS is an expected error code that should not raise
|
||||
# an exception, rather return the code to be handled separately
|
||||
if response and response.code == ErrorCode.OBJECT_EXISTS:
|
||||
return response.code
|
||||
else:
|
||||
raise e
|
||||
|
||||
def _convert_list_to_dict(self, listToConvert: list[tuple[str, list]]):
|
||||
|
@ -1625,6 +1630,11 @@ class Domain(TimeStampedModel, DomainHelper):
|
|||
return response.code
|
||||
except RegistryError as e:
|
||||
logger.error("Error _update_host, code was %s error was %s" % (e.code, e))
|
||||
# OBJECT_EXISTS is an expected error code that should not raise
|
||||
# an exception, rather return the code to be handled separately
|
||||
if response and response.code == ErrorCode.OBJECT_EXISTS:
|
||||
return response.code
|
||||
else:
|
||||
raise e
|
||||
|
||||
def addAndRemoveHostsFromDomain(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue