The following controller action cause the error:
(block: => scala.concurrent.Future[play.api.mvc.SimpleResult])play.api.mvc.Action[play.api.mvc.AnyContent] cannot be applied to (scala.concurrent.Future[Object])".
Every Future inside the action should be Ok()
so I don't understand why scala can't resolve the futures correctly.
def form = Action.async {
val checkSetup: Future[Response] = EsClient.execute(new IndexExistsQuery("fbl_indices"))
checkSetup map {
case result if result.status == 200 => Ok("form")
case result => {
val createIndexResult: Future[Response] = EsClient.execute(new FillableSetupQuery())
createIndexResult map {
indexCreated => Ok("form").flashing("success" -> "alles tutti")
} recover {
case e: Throwable => Ok("form error").flashing("message" -> "error indexerzeugung")
}
}
} recover {
case e: Throwable => Ok("form error").flashing("message" -> "error index query")
}
}
Complete Error messages:
overloaded method value async with alternatives: [A](bodyParser: play.api.mvc.BodyParser[A])(block: play.api.mvc.Request[A] => scala.concurrent.Future[play.api.mvc.SimpleResult])play.api.mvc.Action[A] <and> (block: play.api.mvc.Request[play.api.mvc.AnyContent] => scala.concurrent.Future[play.api.mvc.SimpleResult])play.api.mvc.Action[play.api.mvc.AnyContent] <and> (block: => scala.concurrent.Future[play.api.mvc.SimpleResult])play.api.mvc.Action[play.api.mvc.AnyContent] cannot be applied to (scala.concurrent.Future[Object])