[PyQt] Catching exceptions everywhere

Grissiom chaos.proton at gmail.com
Thu May 7 13:09:49 BST 2009


在 星期四 07 五月 2009 19:47:41,Frédéric Mantegazza 写道:
> > 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?

Maybe this way is too painful I think...
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20090507/0e01a360/attachment.html


More information about the PyQt mailing list