programmerPhysicist / Project_Hype-Berry

Work in progress, but intended to sync Habitica with Todoist. We haven't decided on a good name for the project, so we are going with Project Hype-Berry for the moment.
3 stars 0 forks source link

Fix key error issue #3

Open programmerPhysicist opened 11 months ago

programmerPhysicist commented 11 months ago

Sometimes, when running the script, you will get the following error:

Traceback (most recent call last):
  File "/home/user/Workspace/habitica-workspace/Habitica-Plus-Todoist/source/oneWaySync.py", line 223, in <module>
    sync_todoist_to_habitica()
  File "/home/user/Workspace/habitica-workspace/Habitica-Plus-Todoist/source/oneWaySync.py", line 119, in sync_todoist_to_habitica
    fin_hab = main.get_hab_fromID(tid)
  File "/home/user/Workspace/habitica-workspace/Habitica-Plus-Todoist/source/main.py", line 228, in get_hab_fromID
    hab = HabTask(task['data'])
KeyError: 'data'
programmerPhysicist commented 11 months ago

This issue is related to a TODO in the code: # TODO: handle error cases for response We need to do what is said in the TODO to at least partially fix the issue. The other thing that needs to happen, is we need to stay within the rate limit of Habitica: https://github.com/programmerPhysicist/Habitica-Plus-Todoist/issues/6