in payment-failure/src/main/scala/com/gu/identity/paymentfailure/Lambda.scala [40:48]
def logAndThrowErrors(errors: NonEmptyList[Throwable]): Unit = {
logger.error("error(s) occurred whilst processing event")
errors.zipWithIndex.map { case (err, i) =>
// Log each error separately rather than building composite error message as string.
// Easier to get full information about each error (cause, stack trace etc).
logger.error(s"error ${i + 1}", err)
}
throw Error(errors)
}