Fix the Exception with e.message problem 75/114075/1
authordengyh <dengyuanhong@chinamobile.com>
Wed, 21 Oct 2020 03:04:40 +0000 (11:04 +0800)
committerdengyh <dengyuanhong@chinamobile.com>
Wed, 21 Oct 2020 03:04:47 +0000 (11:04 +0800)
Issue-ID: MODELING-406
Change-Id: I0c1b7801808d480045bacc42cb758388ec6b797a
Signed-off-by: dengyh <dengyuanhong@chinamobile.com>
catalog/pub/Dmaap_lib/dmaap/consumer.py
catalog/pub/Dmaap_lib/dmaap/publisher.py

index d5b5351..2b56865 100644 (file)
@@ -89,4 +89,4 @@ class ConsumerClient:
                 msgs.append(msg)
             return msgs
         except Exception as e:
-            raise DmaapClientException(e.message)
+            raise DmaapClientException(str(e))
index 23a2351..3ffff54 100644 (file)
@@ -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: