mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-06-04 19:47:22 +02:00
handling 99 error message
This commit is contained in:
parent
51375059c1
commit
74c7e6528f
2 changed files with 10 additions and 0 deletions
|
@ -67,6 +67,10 @@ class RegistryError(Exception):
|
|||
def should_retry(self):
|
||||
return self.code == ErrorCode.COMMAND_FAILED
|
||||
|
||||
# connection errors have error code of None and [Errno 99] in the err message
|
||||
def is_connection_error(self):
|
||||
return self.code is None
|
||||
|
||||
def is_session_error(self):
|
||||
return self.code is not None and (self.code >= 2501 and self.code <= 2502)
|
||||
|
||||
|
|
|
@ -753,6 +753,12 @@ class DomainAdmin(ListHeaderAdmin):
|
|||
"Error placing the hold with the registry: {err}",
|
||||
messages.ERROR,
|
||||
)
|
||||
elif err.is_connection_error():
|
||||
self.message_user(
|
||||
request,
|
||||
"Error connecting to the registry",
|
||||
messages.ERROR,
|
||||
)
|
||||
else:
|
||||
# all other type error messages, display the error
|
||||
self.message_user(request, err, messages.ERROR)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue