diff --git a/src/epplibwrapper/errors.py b/src/epplibwrapper/errors.py index c54689706..b9f333d72 100644 --- a/src/epplibwrapper/errors.py +++ b/src/epplibwrapper/errors.py @@ -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) diff --git a/src/registrar/admin.py b/src/registrar/admin.py index 70266bcb8..e3f8d846e 100644 --- a/src/registrar/admin.py +++ b/src/registrar/admin.py @@ -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)