Skip to content

Commit

Permalink
Add raise messaging error
Browse files Browse the repository at this point in the history
  • Loading branch information
pxwxnvermx committed Nov 20, 2024
1 parent 2203e84 commit 2927929
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions commcare_connect/connect_id_client/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
from enum import StrEnum


class MessagingError(Exception):
pass


@dataclasses.dataclass
class ConnectIdUser:
name: str
Expand Down Expand Up @@ -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))


Expand Down

0 comments on commit 2927929

Please sign in to comment.