Details
-
Improvement
-
Status: Open
-
Medium
-
Resolution: Unresolved
-
None
-
None
-
None
Description
Here and in other places, if an exception occurs, not enough information is logged. It can changed to something like
try: ... except Exception as e: print("{} :- {}".format(type(e), e)) print('Unable to push data to ElasticSearch')
When I ran this code, I got a type error because in Python 3 the json.loads expects a decoded string and not bytes (which was fine in python 2). Any other type of exception might occur hence this is a good thing to add.