How to get object that caused failure in Akka Streams?
问题 According to akka streams docs one can handle stream failure by defining a decider that maps a Throwable to a Strategy : val decider: Supervision.Decider = { case _: ArithmeticException => Supervision.Resume case _ => Supervision.Stop } I wonder if there is a way to also get access to the element that caused the error. Of course, the type of this element is unknown, but is there a way to get it even as an instance of Object ? 回答1: The trivial way would be to catch the ArithmeticException near