Skip to content

Commit

Permalink
Merge pull request #20 from sirstudly/fix_comet_exception_handling
Browse files Browse the repository at this point in the history
Fixing up Comet exception handling
  • Loading branch information
funkypenguin authored Dec 20, 2024
2 parents b37191c + 0e48384 commit eef4cb8
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion scraper/services/comet.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,11 @@ def request(func, *args):
try:
json_response = json.loads(response.content, object_hook=lambda d: SimpleNamespace(**d))
except Exception as e:
ui_print('[comet] error: unable to parse response:' + response.content.decode("utf-8") + " " + str(e))
if hasattr(response, "content"):
ui_print('[comet] error: unable to parse response:' + response.content.decode("utf-8"))
else:
ui_print('[comet] error: unable to parse response.')
ui_print('[comet] ' + str(e), ui_settings.debug)
return []
return json_response

Expand Down

0 comments on commit eef4cb8

Please sign in to comment.