summaryrefslogtreecommitdiffstats
path: root/components/pm-subscription-handler/pmsh_service/mod/pmsh_utils.py
diff options
context:
space:
mode:
Diffstat (limited to 'components/pm-subscription-handler/pmsh_service/mod/pmsh_utils.py')
-rwxr-xr-xcomponents/pm-subscription-handler/pmsh_service/mod/pmsh_utils.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/components/pm-subscription-handler/pmsh_service/mod/pmsh_utils.py b/components/pm-subscription-handler/pmsh_service/mod/pmsh_utils.py
index 24eade98..c6be38d0 100755
--- a/components/pm-subscription-handler/pmsh_service/mod/pmsh_utils.py
+++ b/components/pm-subscription-handler/pmsh_service/mod/pmsh_utils.py
@@ -114,13 +114,11 @@ class AppConfig:
"""
try:
app_conf = self._get_pmsh_config()
- if "INVALID JSON" in app_conf.values():
- raise ValueError('Failed to refresh AppConfig: INVALID JSON')
self.subscription.administrativeState = app_conf['policy']['subscription'][
'administrativeState']
logger.info("AppConfig data has been refreshed")
except ValueError or Exception as e:
- logger.error(e)
+ logger.error(f'Failed to refresh AppConfig: {e}', exc_info=True)
def get_mr_sub(self, sub_name):
"""
@@ -287,4 +285,7 @@ class PeriodicTask(Timer):
def run(self):
self.function(*self.args, **self.kwargs)
while not self.finished.wait(self.interval):
- self.function(*self.args, **self.kwargs)
+ try:
+ self.function(*self.args, **self.kwargs)
+ except Exception as e:
+ logger.error(f'Exception in thread: {self.name}: {e}', exc_info=True)