From 29020a784229dcdf3f0a5ad0558b5c58e00b904a Mon Sep 17 00:00:00 2001 From: dengyh Date: Wed, 21 Oct 2020 11:04:40 +0800 Subject: [PATCH] Fix the Exception with e.message problem Issue-ID: MODELING-406 Change-Id: I0c1b7801808d480045bacc42cb758388ec6b797a Signed-off-by: dengyh --- catalog/pub/Dmaap_lib/dmaap/consumer.py | 2 +- 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: -- 2.16.6