error when the responses is empty
Expected Behavior
Actual Behavior
File ".../PokemonGo-Bot-dev/pokemongo_bot/stepper.py", line 89, in _work_at_position
json.dump({'lat': lat, 'lng': lng,'cells':response_dict['responses']['GET_MAP_OBJECTS']['map_cells']}, outfile)
KeyError: 'GET_MAP_OBJECTS'
File ".../PokemonGo-Bot/pokemongo_bot/__init__.py", line 310, in pokeball_inventory
inventory_dict = inventory_req['responses']['GET_INVENTORY'][
KeyError: 'GET_INVENTORY'
[2016-07-24 21:10:43] [#] Finished walking
[2016-07-24 21:10:43] [#] Arrived at Pokestop
2016-07-24 21:10:47 [#] Now at Pokestop: Unknown - Spinning...
Steps to Reproduce
Other Information
I wonder is there a systematic way to solve the issue when the http response is empty.
I think all the error above come from an empty responses. And I have noticed you add some ifcondition to see whether the key exist. but it would be painful to add if condition everywhere. Sometime the return is empty just because unstable network and you can try resend and get the result. but sometimes it might because your account is offline.
Perhaps one could just catch this behavior and restart the bot at current position automatically?
Please confirm if issue persists with commit ec1ba9b8c914ddb914e4901b632556ad840ccf42 as changes was made to code related to this issue
I got the issue today. Same as OP
Got issue today