Created
May 23, 2020 22:28
-
-
Save dkomanov/d96e1fba65907591e9ec8ef2f2c3223f to your computer and use it in GitHub Desktop.
[writing-async-app-in-scala-part-2] Safe Exception Propagation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Future(42) | |
.map[Int](_ => throw new IllegalArgumentException) | |
.flatMap[Int](_ => throw new IllegalStateException) | |
// Effectively: Future.failed(new IllegalArgumentException) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment