Starting to program in python I felt at home with its error reporting. Now that I'm programming with Tkinter instead, I'm finding that it often happens that there are errors in my program that I do not notice even if they generate an exception: I catch them (sometimes) just because I go debugging Step by Step (I use wingIDE) and e.g. at a given line I see the exception reported. But what annoys me is that the program doesn't stop, yet this happens even in blocks not inside try/error.
If what I said makes any sense, do you know about some overall approach to at least display the errors? Being in Tkinter I could create an error window, and fill it with any exception is being generated, when it happens.
See the answers to How can I make silent exceptions louder in tkinter which show how to hook a callback into
tkinter.Tk.report_callback_exception
.I prefer explicit extending Toplevel widget of Tk which represents mostly the main window of an application instead of injecting a hack:
IMHO it looks like a right way.
As @jochen-ritzel said (Should I make silent exceptions louder in tkinter?), there is
tk.TK.report_callback_exception()
that you can override: