Closed nickbroon closed 5 years ago
Different traceback in the same area, this time from the request.get()
call
Mar 11 17:22:02 raspberrypi weather.py[19950]: Traceback (most recent call last):
Mar 11 17:22:02 raspberrypi weather.py[19950]: File "/home/pi/breakout-garden/examples/weather/weather.py", line 164,
Mar 11 17:22:02 raspberrypi weather.py[19950]: weather_icon = get_weather_icon(get_weather(coords))
Mar 11 17:22:02 raspberrypi weather.py[19950]: File "/home/pi/breakout-garden/examples/weather/weather.py", line 76, i
Mar 11 17:22:02 raspberrypi weather.py[19950]: .join([str(c) for c in coords])))
Mar 11 17:22:02 raspberrypi weather.py[19950]: File "/usr/local/lib/python2.7/dist-packages/requests/api.py", line 75,
Mar 11 17:22:02 raspberrypi weather.py[19950]: return request('get', url, params=params, **kwargs)
Mar 11 17:22:02 raspberrypi weather.py[19950]: File "/usr/local/lib/python2.7/dist-packages/requests/api.py", line 60,
Mar 11 17:22:02 raspberrypi weather.py[19950]: return session.request(method=method, url=url, **kwargs)
Mar 11 17:22:02 raspberrypi weather.py[19950]: File "/usr/local/lib/python2.7/dist-packages/requests/sessions.py", lin
Mar 11 17:22:02 raspberrypi weather.py[19950]: resp = self.send(prep, **send_kwargs)
Mar 11 17:22:02 raspberrypi weather.py[19950]: File "/usr/local/lib/python2.7/dist-packages/requests/sessions.py", lin
Mar 11 17:22:02 raspberrypi weather.py[19950]: r = adapter.send(request, **kwargs)
Mar 11 17:22:02 raspberrypi weather.py[19950]: File "/usr/local/lib/python2.7/dist-packages/requests/adapters.py", lin
Mar 11 17:22:02 raspberrypi weather.py[19950]: raise ConnectionError(e, request=request)
Mar 11 17:22:02 raspberrypi weather.py[19950]: requests.exceptions.ConnectionError: HTTPSConnectionPool(host='darksky.ne
Mar 11 17:22:03 raspberrypi systemd[1]: weather-oled.service: Main process exited, code=exited, status=1/FAILURE
Occasional traceback in the get_weather function
I'd guess that try/except is needed round the call to
request.get()
call in the case in intermittent network error and also a check performed thatsoup.findall()
that it actually finds something that can then be split.