programmerPhysicist / Habitica-Plus-Todoist

Work in progress, but intended to sync current API for Habitica with current API for Todoist.
3 stars 0 forks source link

Fix key error issue #3

Open programmerPhysicist opened 8 months ago

programmerPhysicist commented 8 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 8 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