From fa5ac29606697de42a9f2630bb93aba82d7e8bcb Mon Sep 17 00:00:00 2001 From: Erin <121973038+erinysong@users.noreply.github.com> Date: Fri, 1 Dec 2023 15:18:57 -0800 Subject: [PATCH] Specified error messages and function comments --- src/api/views.py | 2 +- src/registrar/models/utility/domain_helper.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/api/views.py b/src/api/views.py index 93d27a382..85ae021c9 100644 --- a/src/api/views.py +++ b/src/api/views.py @@ -64,7 +64,7 @@ def check_domain_available(domain): 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 - a match. + a match. If check fails, throws a RegistryError. """ Domain = apps.get_model("registrar.Domain") if domain.endswith(".gov"): diff --git a/src/registrar/models/utility/domain_helper.py b/src/registrar/models/utility/domain_helper.py index 14cae53bc..c8419ca54 100644 --- a/src/registrar/models/utility/domain_helper.py +++ b/src/registrar/models/utility/domain_helper.py @@ -40,8 +40,8 @@ class DomainHelper: try: if not check_domain_available(domain): raise errors.DomainUnavailableError() - except Exception: - raise errors.RegistrySystemError() + except RegistryError as err: + raise errors.RegistrySystemError() from err return domain @classmethod