Skip to content

Instantly share code, notes, and snippets.

@dkomanov
Created May 23, 2020 22:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dkomanov/4b350c620e0da4189b6e2122f45e0557 to your computer and use it in GitHub Desktop.
Save dkomanov/4b350c620e0da4189b6e2122f45e0557 to your computer and use it in GitHub Desktop.
[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