From de21eafe7b50791144d2bfca37ee721fe5cb00d7 Mon Sep 17 00:00:00 2001 From: Lord Anton Hvornum Date: Thu, 11 May 2017 21:18:27 +0200 Subject: [PATCH] Swapped out for a better error output. You had no idea where errors occured before. --- fbchat/client.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/fbchat/client.py b/fbchat/client.py index 633124c..6aa5793 100644 --- a/fbchat/client.py +++ b/fbchat/client.py @@ -24,6 +24,7 @@ from .models import * from .stickers import * import time import sys +import traceback # Python 3 does not have raw_input, whereas Python 2 has and it's more secure try: @@ -653,7 +654,8 @@ class Client(object): for participant in j['payload']['participants']: participants[participant["fbid"]] = participant["name"] except Exception as e: - log.warning(str(j)) + traceback.print_exc() +# log.warning(str(j)) # Prevent duplicates in self.threads threadIDs = [getattr(x, "thread_id") for x in self.threads] @@ -1026,7 +1028,8 @@ class Client(object): def on_message_error(self, exception, message): """subclass Client and override this method to add custom behavior on event""" - log.warning("Exception:\n{}".format(exception)) + traceback.print_exc() +# log.warning("Exception:\n{}".format(exception)) def on_qprimer(self, timestamp):