'Raise Error Response in case of error'

def _check_response_error(self, req, resp):

    if is_success(resp.status_int):
        return
    close_if_possible(resp.app_iter)
    if is_client_error(resp.status_int):
        raise HTTPPreconditionFailed(request=req)
    raise HTTPServiceUnavailable(request=req)
