Created
November 28, 2013 23:44
-
-
Save cldellow/7699599 to your computer and use it in GitHub Desktop.
Exceptions and promises
This file contains hidden or 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
| import dispatch._ | |
| def func = Http(host("exaadsfadsfmple.com") OK as.String) | |
| try { | |
| val rv = func.flatMap { _ => Promise(1) } | |
| rv() // Doesn't reach here, prints out message | |
| println("I'll never get here") | |
| } catch { | |
| case e: Exception => println("I'll catch this, but you'll still see the JRE printing a stack trace for a BG thread") | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment