Catching Throwable in Scala

Because of Scala‘s pattern matching syntax it is really convenient to catch Throwable instead of Exception or any other exception type. Instead of writing: try { iMayHaveIllegalState.doSomething() } catch { case e: IllegalStateException => e.printStackTrace() } we can simply write: try { iMayHaveIllegalState.doSomething() } catch { case e => e.printStackTrace() } You might be tempted […]