public static void stacktrace (Throwable e) {
        e.printStackTrace();
        final StringBuilder msg = new StringBuilder(e.toString());
        if (state != null) {
            System.out.println(state.currentThread.stackTrace);
            msg.append("\nstack trace: " + state.currentThread.stackTrace);
        }
        for(StackTraceElement ste : e.getStackTrace()) {
            msg.append("\nat " + ste);
        }
        final String msgString = msg.toString();
        log(msgString, LOG_ERROR);
        ui.showError(msgString);
    }
utility function to dump stack trace and show a semi-meaningful error
main/src/main/java/cgeo/geocaching/wherigo/openwig/Engine.java