do no exit if a user changed or does not provide the correct host, client_id, client_key, login, pass

This commit is contained in:
FoxMaSk
2017-09-23 21:18:28 +02:00
parent 0c40a35559
commit 5b3cd028a7
2 changed files with 15 additions and 12 deletions

View File

@@ -1,2 +1,2 @@
VERSION = (1, 2, 0) # PEP 386 VERSION = (1, 2, 1) # PEP 386
__version__ = ".".join([str(x) for x in VERSION]) __version__ = ".".join([str(x) for x in VERSION])

View File

@@ -97,18 +97,21 @@ class Wallabag(object):
:param responses: the json response :param responses: the json response
:return the json data without 'root' node :return the json data without 'root' node
""" """
if responses.status != 200:
raise HttpProcessingError(code=responses.status,
message=await responses.json())
json_data = {} json_data = {}
try: if responses.status != 200:
json_data = responses.json() err_msg = HttpProcessingError(code=responses.status,
except ClientResponseError as e: message=await responses.json())
# sometimes json_data does not return any json() without logging.error("Wallabag: aiohttp error {err_msg}".format(
# any error. This is due to the grabbing URL which "rejects" err_msg=err_msg))
# the URL else:
logging.error("Wallabag: aiohttp error {code} {message}" try:
.format(code=e.code, message=e.message)) json_data = responses.json()
except ClientResponseError as e:
# sometimes json_data does not return any json() without
# any error. This is due to the grabbing URL which "rejects"
# the URL
logging.error("Wallabag: aiohttp error {code} {message}"
.format(code=e.code, message=e.message))
return await json_data return await json_data
@staticmethod @staticmethod