Generalise retries to handle all 5xx errors.