I am mostly writing a small tools for tech savvy people, e.g. programmers, engineers etc. As those tools are usually quick hacks improved over time I know that there are going to be unhandled exceptions and the users are not going to mind. I would like the user to be able to send me the traceback so I can examine what happened and possibly improve the application.

I usually do wxPython programming but I have done some Java recently. I have hooked up the TaskDialog class to the Thread.UncaughtExceptionHandler() and I am quite happy with the result. Especially that it can catch and handle exceptions from any thread:

enter image description here

enter image description here

I was doing something similar in wxPython for a long time. However:

  1. I had to write a decorator-hack to be able to print exceptions from another thread well.
  2. Even when functional, the result is quite ugly.

enter image description here

Here is the code for both Java and wxPython so you can see what I have done:

Java:

import java.awt.EventQueue;
import javax.swing.JFrame;
import javax.swing.UIManager;
import javax.swing.UnsupportedLookAndFeelException;
import javax.swing.JButton;
import java.awt.GridBagLayout;
import java.awt.GridBagConstraints;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;

import com.ezware.dialog.task.TaskDialogs;

public class SwingExceptionTest {

    private JFrame frame;

    public static void main(String[] args) {

        try {
            UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
        }
        catch (ClassNotFoundException e) {
        }
        catch (InstantiationException e) {
Edit
Report