mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-05-19 10:59:21 +02:00
Specified error messages and function comments
This commit is contained in:
parent
4d3c7b94f5
commit
fa5ac29606
2 changed files with 3 additions and 3 deletions
|
@ -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"):
|
||||||
|
|
|
@ -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
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue