mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-07-30 22:46:30 +02:00
consolidation of nameserver view error messages
This commit is contained in:
parent
293eb40cff
commit
2bf7847654
3 changed files with 19 additions and 9 deletions
|
@ -36,6 +36,7 @@ class NameserverErrorCodes(IntEnum):
|
|||
INVALID_IP = 3
|
||||
TOO_MANY_HOSTS = 4
|
||||
UNABLE_TO_UPDATE_DOMAIN = 5
|
||||
MISSING_HOST = 6
|
||||
|
||||
|
||||
class NameserverError(Exception):
|
||||
|
@ -45,10 +46,10 @@ class NameserverError(Exception):
|
|||
"""
|
||||
|
||||
_error_mapping = {
|
||||
NameserverErrorCodes.MISSING_IP: "Nameserver {} needs to have an "
|
||||
"IP address because it is a subdomain",
|
||||
NameserverErrorCodes.GLUE_RECORD_NOT_ALLOWED: "Nameserver {} cannot be linked "
|
||||
"because it is not a subdomain",
|
||||
NameserverErrorCodes.MISSING_IP: "Subdomains require an IP address",
|
||||
NameserverErrorCodes.GLUE_RECORD_NOT_ALLOWED: (
|
||||
"Name server address does not match domain name"
|
||||
),
|
||||
NameserverErrorCodes.INVALID_IP: "Nameserver {} has an invalid IP address: {}",
|
||||
NameserverErrorCodes.TOO_MANY_HOSTS: (
|
||||
"Too many hosts provided, you may not have more than 13 nameservers."
|
||||
|
@ -57,6 +58,9 @@ class NameserverError(Exception):
|
|||
"Unable to update domain, changes were not applied."
|
||||
"Check logs as a Registry Error is the likely cause"
|
||||
),
|
||||
NameserverErrorCodes.MISSING_HOST: (
|
||||
"Name server must be provided to enter IP address."
|
||||
),
|
||||
}
|
||||
|
||||
def __init__(self, *args, code=None, nameserver=None, ip=None, **kwargs):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue