pdk.ErrorClasses ($Date: 2002/12/04 10:13:05 $)
index
pdk/ErrorClasses.py

Error handling classes for pdk.

FOG 10/2000

 
Classes
            
exceptions.StandardError(exceptions.Exception)
pdkError
 
class pdkError(exceptions.StandardError)
     
Purpose:base class for error handling
Detail:

every error class provides a "DOMAIN" attribute specifying the domain of the error and a "CODES" attribute, which lists all exceptions to be handled as

error_code : (error message, hint message)

pairs. When instantiating an error, a second string can be passed to the constructor that contains additional localized information about where the error occurred. Inheriting from this class makes the code dictionaries from all base classes available to the subclass (entries with the same code are overwritten by the subclass). This way, the data class hierarchy can be effectively shadowed by an error class hierarchy without having to duplicate base-class level error codes.


 
  
Method resolution order:
pdkError
exceptions.StandardError
exceptions.Exception

Methods defined here:
__init__(self, code, detail='')
__str__(self)
# this causes the properly formatted error message to print in interactive # use:
getErrorString(self, tb=None)
returns a formatted error message. If a traceback object is passed as the tb argument, and if the PRINT_TRACEBACK attribute is set, it will be printed instead of the current traceback. This is useful when calling getErrorString() from within another error handling function.
handle(self, outStream=<open file '<stderr>', mode 'w'>)

Data and non-method functions defined here:
CODES = {'not_yet_implemented': ("Sorry, this feature isn't implemented yet!", '')}
DOMAIN = 'Generic Error'
LINE_WIDTH = 100
PRINT_TRACEBACK = 1
 
Functions
            
print_tracebacks(flag=1)
enable/disable printing of tracebacks for error messages generated by classes derived from pdkError.
set_error_linewidth(width=100)
sets the line width for error messages generated by classes derived from pdkError.
 
Author
            
$Author: gathmann $