One of the options is an exception at a very high level of your application (the upper part will be the main method).
Another option is to use UncaughtExceptionHandler (if you are on the JVM):
object MyUncaughtExceptionHandler extends Thread.UncaughtExceptionHandler { def uncaughtException(thread: Thread, throwable: Throwable) { println("Something bad happened!") } } val t = new Thread(new Runnable { override def run() { null.toString } }); t.setUncaughtExceptionHandler(MyUncaughtExceptionHandler) t.start()
source share