From 1b2167f20752bf44935dd4c713c10bcbce7ea3c9 Mon Sep 17 00:00:00 2001 From: Schimon Jehudah Date: Wed, 13 Mar 2024 14:35:57 +0000 Subject: [PATCH] Output message instead of status code only. --- slixfeed/action.py | 3 +++ slixfeed/version.py | 4 ++-- slixfeed/xmpp/process.py | 4 +++- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/slixfeed/action.py b/slixfeed/action.py index 73046ad..1b5e0f8 100644 --- a/slixfeed/action.py +++ b/slixfeed/action.py @@ -880,6 +880,7 @@ async def add_feed(self, jid_bare, db_file, url): 'name' : None, 'code' : status_code, 'error' : True, + 'message': result['message'], 'exist' : False} break elif isinstance(result, list): @@ -895,6 +896,7 @@ async def add_feed(self, jid_bare, db_file, url): 'name' : None, 'code' : status_code, 'error' : True, + 'message': result['message'], 'exist' : False} break else: @@ -905,6 +907,7 @@ async def add_feed(self, jid_bare, db_file, url): 'name' : name, 'code' : None, 'error' : False, + 'message': result['message'], 'exist' : True} break return result_final diff --git a/slixfeed/version.py b/slixfeed/version.py index 004c8c5..85332e7 100644 --- a/slixfeed/version.py +++ b/slixfeed/version.py @@ -1,2 +1,2 @@ -__version__ = '0.1.41' -__version_info__ = (0, 1, 41) +__version__ = '0.1.42' +__version_info__ = (0, 1, 42) diff --git a/slixfeed/xmpp/process.py b/slixfeed/xmpp/process.py index 6a4c6b0..7a88f79 100644 --- a/slixfeed/xmpp/process.py +++ b/slixfeed/xmpp/process.py @@ -679,7 +679,9 @@ async def message(self, message): result['index'])) elif result['error']: response = ('> {}\nFailed to find subscriptions. ' - 'Reason: {}'.format(url, result['code'])) + 'Reason: {} (status code: {})' + .format(url, result['message'], + result['code'])) else: response = ('> {}\nNews source "{}" has been ' 'added to subscription list.'