Fixed a few exception values, see #303

This commit is contained in:
Mads Marquart
2018-06-21 15:23:43 +02:00
parent cee6039ec3
commit 4f032cd946

View File

@@ -123,7 +123,7 @@ class ReqUrl(object):
EVENT_REMINDER = "https://www.facebook.com/ajax/eventreminder/create" EVENT_REMINDER = "https://www.facebook.com/ajax/eventreminder/create"
MODERN_SETTINGS_MENU = "https://www.facebook.com/bluebar/modern_settings_menu/" MODERN_SETTINGS_MENU = "https://www.facebook.com/bluebar/modern_settings_menu/"
REMOVE_FRIEND = "https://m.facebook.com/a/removefriend.php" REMOVE_FRIEND = "https://m.facebook.com/a/removefriend.php"
pull_channel = 0 pull_channel = 0
def change_pull_channel(self, channel=None): def change_pull_channel(self, channel=None):
@@ -144,7 +144,7 @@ def strip_to_json(text):
try: try:
return text[text.index('{'):] return text[text.index('{'):]
except ValueError: except ValueError:
raise FBchatException('No JSON object found: {}, {}'.format(repr(text), text.index('{'))) raise FBchatException('No JSON object found: {!r}'.format(text))
def get_decoded_r(r): def get_decoded_r(r):
return get_decoded(r._content) return get_decoded(r._content)
@@ -211,7 +211,7 @@ def check_request(r, as_json=True):
try: try:
j = json.loads(content) j = json.loads(content)
except ValueError: except ValueError:
raise FBchatFacebookError('Error while parsing JSON: {}'.format(repr(content))) raise FBchatFacebookError('Error while parsing JSON: {!r}'.format(content))
check_json(j) check_json(j)
return j return j
else: else: