attempt the first at generalizing retries