mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-08-11 20:19:38 +02:00
wip
This commit is contained in:
parent
b4b6565f81
commit
d31af94a15
2 changed files with 13 additions and 6 deletions
|
@ -62,14 +62,18 @@ class RegistryError(Exception):
|
|||
- 2501 - 2502 Something malicious or abusive may have occurred
|
||||
"""
|
||||
|
||||
def __init__(self, *args, code=None, note="", **kwargs):
|
||||
def __init__(self, *args, code=None, note="", response=None, **kwargs):
|
||||
super().__init__(*args, **kwargs)
|
||||
self.code = code
|
||||
self.response = response
|
||||
# note is a string that can be used to provide additional context
|
||||
self.note = note
|
||||
|
||||
|
||||
def should_retry(self):
|
||||
return self.code == ErrorCode.COMMAND_FAILED
|
||||
# COMMAND_USE_ERROR is returning with message, Registrar is not logged in,
|
||||
# which can be recovered from with a retry
|
||||
return self.code == ErrorCode.COMMAND_FAILED or self.code == ErrorCode.COMMAND_USE_ERROR
|
||||
|
||||
def is_transport_error(self):
|
||||
return self.code == ErrorCode.TRANSPORT_ERROR
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue