in src/main/scala/com/gu/zuora/fullexport/Impl.scala [207:216]
@tailrec def retry[T](n: Int)(fn: => T): T = {
util.Try { fn } match {
case Success(x) => x
case Failure(e) if n > 1 =>
logger.warn(s"Retrying operation due to failure: $e")
retry(n - 1)(fn)
case util.Failure(e) => throw e
}
}