First pass EPP retry

This commit is contained in:
Erin 2023-12-05 11:35:08 -08:00
parent c569db24f3
commit 4a25642d8d
No known key found for this signature in database
GPG key ID: 1CAD275313C62460
4 changed files with 22 additions and 4 deletions

View file

@ -4,13 +4,15 @@ from enum import IntEnum
class ErrorCode(IntEnum):
"""
Overview of registry response codes from RFC 5730. See RFC 5730 for full text.
- 0 System connection error
- 1000 - 1500 Success
- 2000 - 2308 Registrar did something silly
- 2400 - 2500 Registry did something silly
- 2501 - 2502 Something malicious or abusive may have occurred
"""
TRANSPORT_ERROR = 0
COMMAND_COMPLETED_SUCCESSFULLY = 1000
COMMAND_COMPLETED_SUCCESSFULLY_ACTION_PENDING = 1001
COMMAND_COMPLETED_SUCCESSFULLY_NO_MESSAGES = 1300
@ -67,6 +69,9 @@ class RegistryError(Exception):
def should_retry(self):
return self.code == ErrorCode.COMMAND_FAILED
def is_transport_error(self):
return self.code == ErrorCode.TRANSPORT_ERROR
# connection errors have error code of None and [Errno 99] in the err message
def is_connection_error(self):
return self.code is None