Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
[writing-async-app-in-scala-part-2] Unsafe Exception Propagation
def innocentFunction(param: AnyRef): Future[Int] = {
require(param != null)
Future.successful(42)
}
innocentFunction(null)
.map(_ => throw new IllegalStateException)
// an IllegalArgumentException will be thrown before map call
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment