2023-06-08 13:55:41 +08:00
|
|
|
class BaseFailed(Exception):
|
|
|
|
|
"""
|
|
|
|
|
Failed is base exception for all Failed... exceptions.
|
|
|
|
|
This exception is indicates error while performing some phone notification operation.
|
|
|
|
|
Optionally can contain graceful_msg attribute. When graceful_msg is provided it mean that error on provider side is
|
|
|
|
|
not our fault, but some provider error (number is blocked, fraud guard, ...).
|
|
|
|
|
By default, graceful_msg is None - it means that error is our fault (network problems, invalid configuration,...).
|
|
|
|
|
|
|
|
|
|
Attributes:
|
|
|
|
|
graceful_msg: string with some details about exception which can be exposed to caller.
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
def __init__(self, graceful_msg=None):
|
|
|
|
|
self.graceful_msg = graceful_msg
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class FailedToMakeCall(BaseFailed):
|
2023-05-24 14:27:48 +08:00
|
|
|
pass
|
|
|
|
|
|
|
|
|
|
|
2023-06-08 13:55:41 +08:00
|
|
|
class FailedToSendSMS(BaseFailed):
|
2023-05-24 14:27:48 +08:00
|
|
|
pass
|
|
|
|
|
|
|
|
|
|
|
2023-06-08 13:55:41 +08:00
|
|
|
class FailedToStartVerification(BaseFailed):
|
2023-05-24 14:27:48 +08:00
|
|
|
pass
|
|
|
|
|
|
|
|
|
|
|
2023-06-08 13:55:41 +08:00
|
|
|
class FailedToFinishVerification(BaseFailed):
|
2023-05-24 14:27:48 +08:00
|
|
|
pass
|
|
|
|
|
|
|
|
|
|
|
2023-06-08 13:55:41 +08:00
|
|
|
class NumberNotVerified(Exception):
|
2023-05-24 14:27:48 +08:00
|
|
|
pass
|
|
|
|
|
|
|
|
|
|
|
2023-06-08 13:55:41 +08:00
|
|
|
class NumberAlreadyVerified(Exception):
|
2023-05-24 14:27:48 +08:00
|
|
|
pass
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class ProviderNotSupports(Exception):
|
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class CallsLimitExceeded(Exception):
|
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class SMSLimitExceeded(Exception):
|
|
|
|
|
pass
|
2024-06-20 10:09:24 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
class PhoneNumberBanned(Exception):
|
|
|
|
|
pass
|