diff options
author | 2020-10-21 11:04:40 +0800 | |
---|---|---|
committer | 2020-10-21 11:04:47 +0800 | |
commit | 29020a784229dcdf3f0a5ad0558b5c58e00b904a (patch) | |
tree | 6a36eb409ceff3aeb15f8b89d17701a35703c05b /catalog | |
parent | 4123780df595fd99883286e351a936349709ef68 (diff) |
Fix the Exception with e.message problem
Issue-ID: MODELING-406
Change-Id: I0c1b7801808d480045bacc42cb758388ec6b797a
Signed-off-by: dengyh <dengyuanhong@chinamobile.com>
Diffstat (limited to 'catalog')
-rw-r--r-- | catalog/pub/Dmaap_lib/dmaap/consumer.py | 2 | ||||
-rw-r--r-- | catalog/pub/Dmaap_lib/dmaap/publisher.py | 6 |
2 files changed, 4 insertions, 4 deletions
diff --git a/catalog/pub/Dmaap_lib/dmaap/consumer.py b/catalog/pub/Dmaap_lib/dmaap/consumer.py index d5b5351..2b56865 100644 --- a/catalog/pub/Dmaap_lib/dmaap/consumer.py +++ b/catalog/pub/Dmaap_lib/dmaap/consumer.py @@ -89,4 +89,4 @@ class ConsumerClient: msgs.append(msg) return msgs except Exception as e: - raise DmaapClientException(e.message) + raise DmaapClientException(str(e)) diff --git a/catalog/pub/Dmaap_lib/dmaap/publisher.py b/catalog/pub/Dmaap_lib/dmaap/publisher.py index 23a2351..3ffff54 100644 --- a/catalog/pub/Dmaap_lib/dmaap/publisher.py +++ b/catalog/pub/Dmaap_lib/dmaap/publisher.py @@ -60,7 +60,7 @@ class BatchPublisherClient: self.pending.append(message) return len(self.pending) except Exception as e: - raise DmaapClientException("append message failed: " + e.message) + raise DmaapClientException("append message failed: " + str(e)) def send_message(self, force): if force or self.should_send_now(): @@ -122,7 +122,7 @@ class BatchPublisherClient: return True except Exception as e: - logger.error(e.message) + logger.error(str(e)) return False def create_headers(self): @@ -163,7 +163,7 @@ class BatchPublisherClient: time.sleep(0.25) return self.pending except Exception as e: - raise DmaapClientException("send message failed: " + e.message) + raise DmaapClientException("send message failed: " + str(e)) class Message: |