def foreach()

in app/models/Attempt.scala [31:44]


  def foreach(f: A => Unit)(implicit ec: ExecutionContext): Unit = map(f)

  /**
    * If there is an error in the Future itself (e.g. a timeout) we convert it to a
    * Left so we have a consistent error representation. This would likely have
    * logging around it, or you may have an error representation that carries more info
    * for these kinds of issues.
    */
  def asFuture(implicit ec: ExecutionContext): Future[Either[AttemptErrors, A]] = {
    underlying recover { case err =>
      val apiErrors = AttemptErrors(AttemptError(err.getMessage, throwable = Some(err)))
      scala.Left(apiErrors)
    }
  }