From f38132e540d193ea5e19010c9559efb968b5ea1f Mon Sep 17 00:00:00 2001 From: Shubham Gupta Date: Thu, 25 Jul 2024 18:40:31 +0530 Subject: [PATCH] fix check for SyftError when updating server setting on notification enable/disable --- .../syft/src/syft/service/notifier/notifier_service.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/syft/src/syft/service/notifier/notifier_service.py b/packages/syft/src/syft/service/notifier/notifier_service.py index 464581a940f..391bf16abd4 100644 --- a/packages/syft/src/syft/service/notifier/notifier_service.py +++ b/packages/syft/src/syft/service/notifier/notifier_service.py @@ -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.") @@ -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")