wizonesolutions / habitrpg-todo-sync

HabitRPG Todo Synchronization
22 stars 3 forks source link

Handle undefined API responses properly #29

Open wizonesolutions opened 11 years ago

wizonesolutions commented 11 years ago

Sometimes I get undefined responses back from getTasks and completeTask. It might be the RTM API throttling itself, but it's confusing in any case. I need to handle the responses properly. Super Agent normally returns false for res.ok in these cases, but maybe we are getting 200 responses? I need to check for undefined responses in any case and act accordingly. Also for undefined task_ids. For some reason we're calling completeTask with undefined task_id fields sometimes.