[PyQt] Catching exceptions everywhere

Frédéric Mantegazza frederic.mantegazza at gbiloba.org
Thu May 7 12:47:41 BST 2009


> Is there a way to catch Python exceptions in all parts of a PyQt program?
>
> I have a "report bug" dialog box which gets called if an exception occurs
> in
> the most frequently used parts of my program, but it would be nice if I
> could catch every unhandled exception globally.
>
> The really nice thing about python is that program tends to keep running
> despite an exception in a slot, so we don't get immediate data loss.

I don't know if it is possible to catch exceptions globally, but I was
thinking of using decorators arround all my PyQt callbacks, to add a
try/except feature, and display something like your "report bug" dialog
box.

Does anybody already done such decorator?

-- 
    Frédéric



More information about the PyQt mailing list