Popular Posts
SwiXml SwiX ml , is a small GUI generating engine for Java applications and applets. Graphical User Interfaces are described in XML documents that ... Temporary Tables Temporary Table create table #temptable { id int, name nvarchar(50) }; select * into #temptable from UserTable; Features Table name ... File properties FOR %%? IN (file_to_be_queried) DO ( ECHO File Name Only : %%~n? ECHO File Extension : %%~x? ECHO Name in 8.3 notati...
Stats
Catch unhandled exception
public class ErrorHandler implements Thread.UncaughtExceptionHandler {

    @Override
    public void uncaughtException(Thread t, Throwable e) {
        System.err.printf("Thread ID : %s%n", t.getId());
        System.err.printf("Message : %s%n", e.getMessage());
    }

    public static void main(String[] args) {
        // register handler
        Thread.setDefaultUncaughtExceptionHandler(new ErrorHandler());

        // throw error
        throw new RuntimeException("My exception!");
    }

}

Know the JVM Series – 1 – The Uncaught Exception Handler