Source code for digital_world_sdk.sep.exceptions
from ..exceptions import BaseRequestError, SdkError
[docs]
class DwTomlNotFoundError(SdkError):
"""If the DWP-1 toml file not found, the exception will be thrown."""
[docs]
class InvalidFederationAddress(SdkError):
"""If the federation address is invalid, the exception will be thrown."""
[docs]
class FederationServerNotFoundError(SdkError):
"""If the federation address is invalid, the exception will be thrown."""
[docs]
class BadFederationResponseError(BaseRequestError):
"""If the federation server does not return a valid response, the exception will be thrown.
:param response: client response
"""
def __init__(self, response) -> None:
super().__init__(response)
self.message: str = response.text
self.status: int = response.status_code
[docs]
class InvalidDwp10ChallengeError(SdkError):
"""If the DWP-10 validation fails, the exception will be thrown."""
class InvalidDwp45ChallengeError(SdkError):
"""If the DWP-45 validation fails, the exception will be thrown."""
class InvalidWasmError(SdkError, ValueError):
"""Raised when a contract Wasm file or section cannot be decoded."""
[docs]
class AccountRequiresMemoError(SdkError):
"""AccountRequiresMemoError is raised when a transaction is trying to submit an
operation to an account which requires a memo.
This error contains two attributes to help you identify the account requiring
the memo and the operation where the account is the destination.
See `DWP-29 <https://gitlab.com/digitalworld/digitalworld-protocol/blob/main/ecosystem/dwp-0029.md>`_ for more
information.
"""
def __init__(self, message, account_id, operation_index) -> None:
super().__init__(message)
self.account_id: str = account_id
self.operation_index: int = operation_index