occasional HTTP 503 errors causes applet to stop updating

Bug #1212850 reported by rwx
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
my-weather-indicator
Fix Released
Critical
Lorenzo Carbonell

Bug Description

Occasionally the app stops updating, and the problem appears that the call to urlopen() is not tolerant of receiving an HTTP error:

Traceback (most recent call last):
  File "/opt/extras.ubuntu.com/my-weather-indicator/share/my-weather-indicator/myweatherindicator.py", line 194, in work
    self.set_menu()
  File "/opt/extras.ubuntu.com/my-weather-indicator/share/my-weather-indicator/myweatherindicator.py", line 462, in set_menu
    weather = self.weatherservice1.get_weather()
  File "/opt/extras.ubuntu.com/my-weather-indicator/share/my-weather-indicator/wundergroundapi.py", line 146, in get_weather
    weather_data = self._get_weather()
  File "/opt/extras.ubuntu.com/my-weather-indicator/share/my-weather-indicator/wundergroundapi.py", line 80, in _get_weather
    json_string = read_from_url(URL%(self.key,self.latitude,self.longitude))
  File "/opt/extras.ubuntu.com/my-weather-indicator/share/my-weather-indicator/comun.py", line 179, in read_from_url
    f = urllib2.urlopen(request)
  File "/usr/lib/python2.7/urllib2.py", line 126, in urlopen
    return _opener.open(url, data, timeout)
  File "/usr/lib/python2.7/urllib2.py", line 406, in open
    response = meth(req, response)
  File "/usr/lib/python2.7/urllib2.py", line 519, in http_response
    'http', request, response, code, msg, hdrs)
  File "/usr/lib/python2.7/urllib2.py", line 444, in error
    return self._call_chain(*args)
  File "/usr/lib/python2.7/urllib2.py", line 378, in _call_chain
    result = func(*args)
  File "/usr/lib/python2.7/urllib2.py", line 527, in http_error_default
    raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
urllib2.HTTPError: HTTP Error 503: Service Unavailable

Tags: http
Changed in my-weather-indicator:
assignee: nobody → Lorenzo Carbonell (lorenzo-carbonell)
importance: Undecided → Critical
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.