Writing Exception Classes
Exception classes are not special, you just derive them from Exception:
Toggle line numbers
1 class HostNotFound(Exception):
2 def __init__( self, host ):
3 self.host = host
4 Exception.__init__(self, 'Host Not Found exception: missing %s' % host)
You may later write:
See Also
HandlingExceptions, TracebackModule
Questions
How do you relay the traceback information? Relay the traceback information? Moving it higher up the call-stack? Could you try to explain your question?
When you're logging exceptions, you want access to the traceback information to. After some research, I believe what you use is extract_tb or extract_stack from the traceback module. -- LionKimbro DateTime(2003-09-07T15:23:43Z)
- What better exception-foo is out there?