def logOnThrown[T]()

in common/src/main/scala/com/gu/sfl/Logging.scala [11:16]


  def logOnThrown[T](function: () => T, messageOnError: String = ""): T = Try(function()) match {
    case Success(value) => value
    case Failure(throwable) =>
      logger.error(s"$messageOnError: ${throwable.getMessage}", throwable)
      throw throwable
  }