Hi Charlie,

I think FutureDirectives.onSuccess() is what you're after.

Cheers
André

On Thursday, December 10, 2015 at 6:24:33 PM UTC+1, Charlie Evans wrote:
>
> Hi all,
>
> I would like to handle exceptions using:
>
> implicit def myExceptionHandler: ExceptionHandler =
>
>     ExceptionHandler {
>
>       case e: Exception => complete(HttpResponse(InternalServerError, 
> entity = e.getMessage))
>
> }
>
>
> when my complete fails in my route. This works fine if I throw an 
> exception in the complete block directly. However, I use an Actor to handle 
> the request with
>
>
> entity(as[Thing]) { thing =>
>
>   complete {
>
>    val handler = system.actorOf(Handler.props, "handler")
>
>    (handler ? thing).mapTo[String]
>
>   }
>
> }
>
>
> If a request fails from an exception thrown in the Handler actor how do I 
> get that exception to propagate back to this point so myExceptionHandler 
> can deal with it?
>
>
> 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 akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
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