def update(): global bike_info try: bike_info = update_data(to_update) except Exception as e: print('something bad happened: ' + str(e)) # schedule execution of update every minute