The current Restarter implementation does not allow any more detailed
decisions as we thought it may be enough and becomes nicely declarative.

Note though that you can install multiple restarter for different exception
types, so if all you want is to have different strategies for different
types of exceptions that is doable.

This means that currently if you want to do some more logic with an
exception you would have to catch it.

--
Johan
Akka Team

On Sat, Jul 29, 2017 at 5:53 PM, NISHANT VISHWAKARMA <nishant...@gmail.com>
wrote:

> Hi Team,
>
> I need to get the details of an exception thrown from a child actor in the
> supervisor.
>
> In the untyped world I could have a decider function like below to get the
> exception details
>
> OneForOneStrategy(maxNrOfRetries = 10, withinTimeRange = 1 minute) {
>      case *ex: ArithmeticException* => println(s"Child is in trouble
> ${ex.getMessage}") // Or any other task
>                                                              Resume
> }
>
> However in the typed world I can only do something like -
>
> Actor
>        .supervise(Child.behavior())
>        .*onFailure[RuntimeException]*(SupervisorStrategy.restartWithLimit(1,
> FiniteDuration(1, "seconds")).withLoggingEnabled(true)),"child")
>
> This doesn't give a way to get hold of the exception value in case there
> is a need to do any other task apart from logging.
>
> Is there a way I can get the exception value in the supervisor? If it's no
> longer supported, is it to encourage any best practices that I am not aware
> of ?
>
> Thanks and Regards,
> Nishant
>
> --
> >>>>>>>>>> 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 https://groups.google.com/group/akka-user.
> For more options, visit https://groups.google.com/d/optout.

-- 
>>>>>>>>>>      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 https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.

Reply via email to