private void handleError(String name, Throwable t) {
        StringWriter writer = new StringWriter();
        writer.append("Apache Tika was unable to parse the document\n");
        writer
                .append("at ")
                .append(name)
                .append(".\n\n");
        writer.append("The full exception stack trace is included below:\n\n");
        t.printStackTrace(new PrintWriter(writer));

        JEditorPane editor = new JEditorPane("text/plain", writer.toString());
        editor.setEditable(false);
        editor.setBackground(Color.WHITE);
        editor.setCaretPosition(0);
        editor.setPreferredSize(new Dimension(600, 400));

        JDialog dialog = new JDialog(this, "Apache Tika error");
        dialog.add(new JScrollPane(editor));
        dialog.pack();
        dialog.setVisible(true);
    }
Main method. Sets the Swing look and feel to the operating system
settings, and starts the Tika GUI with an {@link AutoDetectParser}
instance as the default parser.

@param args ignored
@throws Exception if an error occurs
tika-app/src/main/java/org/apache/tika/gui/TikaGUI.java