Skip to content

Commit

Permalink
fix check for SyftError when updating server setting on notification …
Browse files Browse the repository at this point in the history
…enable/disable
  • Loading branch information
shubham3121 committed Jul 25, 2024
1 parent bf76642 commit f38132e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/syft/src/syft/service/notifier/notifier_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,8 +208,8 @@ def turn_on(

settings_service = context.server.get_service("settingsservice")
result = settings_service.update(context, notifications_enabled=True)
if result.is_err():
logger.info(f"Failed to update Server Settings: {result.err()}")
if isinstance(result, SyftError):
logger.info(f"Failed to update Server Settings: {result.message}")

return SyftSuccess(message="Notifications enabled successfully.")

Expand All @@ -235,8 +235,8 @@ def turn_off(

settings_service = context.server.get_service("settingsservice")
result = settings_service.update(context, notifications_enabled=False)
if result.is_err():
logger.info(f"Failed to update Server Settings: {result.err()}")
if isinstance(result, SyftError):
logger.info(f"Failed to update Server Settings: {result.message}")

return SyftSuccess(message="Notifications disabled succesfullly")

Expand Down

0 comments on commit f38132e

Please sign in to comment.