Output message instead of status code only.

This commit is contained in:
Schimon Jehudah 2024-03-13 14:35:57 +00:00
parent 6d75d02822
commit 1b2167f207
3 changed files with 8 additions and 3 deletions

View file

@ -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

View file

@ -1,2 +1,2 @@
__version__ = '0.1.41'
__version_info__ = (0, 1, 41)
__version__ = '0.1.42'
__version_info__ = (0, 1, 42)

View file

@ -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.'