From 46ed53b2979ff84f54f557689f13fdef8330d2ce Mon Sep 17 00:00:00 2001 From: Noam Date: Thu, 15 Feb 2018 18:26:57 +0200 Subject: [PATCH] Exception handling for list command --- setup.py | 2 +- telegramer/core.py | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/setup.py b/setup.py index 3cf656a..1a6c63d 100755 --- a/setup.py +++ b/setup.py @@ -46,7 +46,7 @@ __plugin_name__ = "Telegramer" __author__ = "Noam" __author_email__ = "noamgit@gmail.com" -__version__ = "1.1.7.3" +__version__ = "1.1.7.4" __url__ = "https://github.com/noam09" __license__ = "GPLv3" __description__ = "Control Deluge using Telegram" diff --git a/telegramer/core.py b/telegramer/core.py index 59f58b9..8fed82b 100755 --- a/telegramer/core.py +++ b/telegramer/core.py @@ -170,11 +170,13 @@ def format_torrent_info(torrent): status = torrent.get_status(INFOS) log.debug(prelog()) log.debug(status) + status_string = '' try: status_string = u''.join([f(status[i], status) for i, f in INFO_DICT if f is not None]) - except UnicodeDecodeError as e: - # status_string = ''.join([f(status[i], status) for i, f in INFO_DICT if f is not None]) - log.error(str(e)) + # except UnicodeDecodeError as e: + except Exception as e: + status_string = '' + log.error(prelog() + str(e) + '\n' + traceback.format_exc()) return status_string