Specified error messages and function comments

This commit is contained in:
Erin 2023-12-01 15:18:57 -08:00
parent 4d3c7b94f5
commit fa5ac29606
No known key found for this signature in database
GPG key ID: 1CAD275313C62460
2 changed files with 3 additions and 3 deletions

View file

@ -64,7 +64,7 @@ def check_domain_available(domain):
The given domain is lowercased to match against the domains list. If the The given domain is lowercased to match against the domains list. If the
given domain doesn't end with .gov, ".gov" is added when looking for given domain doesn't end with .gov, ".gov" is added when looking for
a match. a match. If check fails, throws a RegistryError.
""" """
Domain = apps.get_model("registrar.Domain") Domain = apps.get_model("registrar.Domain")
if domain.endswith(".gov"): if domain.endswith(".gov"):

View file

@ -40,8 +40,8 @@ class DomainHelper:
try: try:
if not check_domain_available(domain): if not check_domain_available(domain):
raise errors.DomainUnavailableError() raise errors.DomainUnavailableError()
except Exception: except RegistryError as err:
raise errors.RegistrySystemError() raise errors.RegistrySystemError() from err
return domain return domain
@classmethod @classmethod