Created
February 10, 2015 13:34
-
-
Save eamelink/9122bf57714e6ac22f2b to your computer and use it in GitHub Desktop.
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
scala> import scala.util.Try | |
scala> object Borked { sys.error("Boom!") } | |
defined object Borked | |
scala> Try(Borked) | |
java.lang.RuntimeException: Boom! | |
at scala.sys.package$.error(package.scala:27) | |
... 38 elided | |
scala> try { Borked } catch { case e => println(e) } | |
<console>:10: warning: This catches all Throwables. If this is really intended, use `case e : Throwable` to clear this warning. | |
try { Borked } catch { case e => println(e) } | |
^ | |
java.lang.NoClassDefFoundError: Could not initialize class $line3.$read$$iw$$iw$Borked$ | |
res2: Any = () | |
scala> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment