diff --git a/commcare_connect/connect_id_client/models.py b/commcare_connect/connect_id_client/models.py index d8bde29c..b72f4d57 100644 --- a/commcare_connect/connect_id_client/models.py +++ b/commcare_connect/connect_id_client/models.py @@ -2,6 +2,10 @@ from enum import StrEnum +class MessagingError(Exception): + pass + + @dataclasses.dataclass class ConnectIdUser: name: str @@ -31,6 +35,9 @@ class UserMessageStatus: @classmethod def build(cls, username: str, status: str, *args, **kwargs): + error = kwargs.pop("error") + if error is not None: + raise MessagingError(error) return cls(username, MessageStatus(status))