Added exception handling for urllib2.HTTPError.