fixed error handling to use urllib HttpError instead of the httplib style