'Use the different parts of the request and response to create an error
and return it.'

def create_error_from_parts(self, req, code, msg, hdrs, resp):

    err = urllib2.HTTPError(req.get_full_url(), code, msg, hdrs, resp)
    err.id = req.id
    return err
