[EMAIL PROTECTED] wrote:
What I am trying to do is get information
from a raised custom exception. I am catching the exception in a
main() function but it was actually raised in a separate module
function. It would be nice if I could print out where the exception
was raised from (module.functio
Peter Hansen wrote:
> [EMAIL PROTECTED] wrote:
> > In Martinelli's Nutshell book in the Exceptions chapter there is an
> > example of a custom exception class (pg.112) that I am trying to
> > implement without success. The custom exception class example
pulls
> > sys.exc_info() into an attribute
[EMAIL PROTECTED] wrote:
In Martinelli's Nutshell book in the Exceptions chapter there is an
example of a custom exception class (pg.112) that I am trying to
implement without success. The custom exception class example pulls
sys.exc_info() into an attribute and I am assuming that the attribute
wo
I don't know the mentioned book, but if you rewrite like:
>>> import sys
>>> class LinuxDriverError(Exception):
... def __init__(self, *args):
... Exception.__init__(self, *args)
... self.message = args[0]
...
... def __str__(self):
... return str(sys.exc_info())
...
In Martinelli's Nutshell book in the Exceptions chapter there is an
example of a custom exception class (pg.112) that I am trying to
implement without success. The custom exception class example pulls
sys.exc_info() into an attribute and I am assuming that the attribute
would then contain the rais