add exception handling and logging to getWeather