Skip to content

Commit

Permalink
raise proper exception for syft responses
Browse files Browse the repository at this point in the history
  • Loading branch information
teo-milea committed May 22, 2024
1 parent 55036c8 commit c4666b3
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions packages/syft/src/syft/service/response.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ class SyftResponseMessage(SyftBaseModel):
_bool: bool = True
require_api_update: bool = False

def __getattr__(self, name: str) -> Any:
raise Exception(
f"You have tried accessing `{name}` on a {type(self).__name__} with message: {self.message}"
)

def __bool__(self) -> bool:
return self._bool

Expand Down

0 comments on commit c4666b3

Please sign in to comment.