From d4f87a40133722da489e4ae03825be544a7baca7 Mon Sep 17 00:00:00 2001 From: Mars chen Date: Thu, 30 Jul 2020 17:36:17 +0800 Subject: [PATCH] fix the bug: Exception with e.message Change-Id: Ia5a24a8dd15ca80cd6f36230933bc4451c7cde67 Issue-ID: MODELING-406 Signed-off-by: Mars chen --- catalog/pub/Dmaap_lib/dmaap/identity.py | 4 ++-- catalog/pub/msapi/sdc_controller.py | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/catalog/pub/Dmaap_lib/dmaap/identity.py b/catalog/pub/Dmaap_lib/dmaap/identity.py index 57f4016..6e801e8 100644 --- a/catalog/pub/Dmaap_lib/dmaap/identity.py +++ b/catalog/pub/Dmaap_lib/dmaap/identity.py @@ -47,7 +47,7 @@ class IdentityClient: } return resp_data except Exception as e: - raise DmaapClientException('create apikey from dmaap failed: ' + e.message) + raise DmaapClientException('create apikey from dmaap failed: ' + str(e)) def get_apikey(self, apikey): try: @@ -59,7 +59,7 @@ class IdentityClient: ret = ret.json() return ret except Exception as e: - raise DmaapClientException('get apikey from dmaap failed: ' + e.message) + raise DmaapClientException('get apikey from dmaap failed: ' + str(e)) def delete_apikey(self): pass diff --git a/catalog/pub/msapi/sdc_controller.py b/catalog/pub/msapi/sdc_controller.py index c46503f..505443a 100644 --- a/catalog/pub/msapi/sdc_controller.py +++ b/catalog/pub/msapi/sdc_controller.py @@ -47,7 +47,7 @@ class SDCController(Thread): self.scheduler.start() except Exception as e: logger.error('start sdc controller failed.') - logger.error(e.message) + logger.error(str(e)) logger.error(traceback.format_exc()) def fetch_notification(self): @@ -62,7 +62,7 @@ class SDCController(Thread): process_notification(notification_callback) except Exception as e: logger.error('fetch message from dmaap failed.') - logger.error(e.message) + logger.error(str(e)) logger.error(traceback.format_exc()) @@ -184,7 +184,7 @@ def send_notification_status(status_topic, now_ms, distribution_id, artifact, is logger.error('failed to send notification status, %s messages unsent', len(stuck)) except Exception as e: logger.error('failed to send notification status.') - logger.error(e.message) + logger.error(str(e)) logger.error(traceback.format_exc()) return status -- 2.16.6