Exceptions for the whole class
I'm writing a program in Python, and nearly every method im my class is written like this: def someMethod(self): try: #... except someException: #in case of exception, do something here #e.g display a dialog box to inform the user #that he has done something wrong As the class grows, it is a little bit annoying to write the same try-except block over and over. Is it possible to create some sort of 'global' exception for the whole class? What's the recommended way in Python to deal with this? Write one or more exception handler functions that, given a function and the exception raised in it,