Added error check to geoloc functions (python and javascript)