[Akka streams] Why is there no GraphStage in akka streams that can give me a failed element along with throwable ?

16 views
Skip to first unread message

Saloni Vithalani

unread,
Apr 12, 2018, 4:49:35 AM4/12/18
to Akka User List
Hello,

Let's say for example we have such a stream

Source(1 to 10)
.map(x ⇒ if (x % 2 == 0) throw new RuntimeException("test error"))
.mapError {
case NonFatal(ex) ⇒
// do something with the failed element 2
ex.printStackTrace()
ex
}

The question is why not mapError give me element '2' along with the 'RuntimeException' ?

Reply all
Reply to author
Forward
0 new messages