I'm using the following code:

 val selfMessage: Future[PutDocument] =
    for {
      r <- {
        val indexer = client execute {
        index into es_index_id id raw_id fields(
            "version_vector" -> List()
            ) opType CREATE
        }
        indexer
      }

      t <- Future{sender}
    } yield {PutDocument(r, t)}

    selfMessage pipeTo self


The purpose of this block is essentially to attempt to put a document with 
a particular id into elastic search. In the case a document with the same 
id exists, the client execute block returns a RemoteTransportException. 
This doesn't satisfy the PutDocument case class which consists of an 
IndexResponse and an ActorRef. I'm unsure about how to catch this failure 
and pipe an error message to self instead.

Thanks!

. 

-- 
>>>>>>>>>>      Read the docs: http://akka.io/docs/
>>>>>>>>>>      Check the FAQ: 
>>>>>>>>>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>>>>>>>>>      Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.

Reply via email to