extensive urllib2 error checks