"""Returns parsed JSON as returned by openweathermap for the given cityid.
In case of errors, an OpenWeatherMapError is raised."""
baseurl = 'http://api.openweathermap.org/data/2.5/weather'
"""Returns parsed JSON as returned by openweathermap for the given cityid.
In case of errors, an OpenWeatherMapError is raised."""
baseurl = 'http://api.openweathermap.org/data/2.5/weather'
if response.status_code != 200:
raise OpenWeatherMapError('Got status code {} ({}).'.format(response.status_code, response.reason))
else:
if response.status_code != 200:
raise OpenWeatherMapError('Got status code {} ({}).'.format(response.status_code, response.reason))
else:
except requests.exceptions.RequestException as error:
raise OpenWeatherMapError('Request not successful: {}'.format(error))
except requests.exceptions.RequestException as error:
raise OpenWeatherMapError('Request not successful: {}'.format(error))