Package install :: Package MoSTBioDat :: Package DataBase :: Package ForgetSQL2 :: Module doc_exception :: Class DocstringException
[hide private]
[frames] | no frames]

Class DocstringException

source code

              object --+        
                       |        
exceptions.BaseException --+    
                           |    
        exceptions.Exception --+
                               |
                              DocstringException
Known Subclasses:

Makes it easy to define more descriptive error messages.

>>> class RealityError(DocstringException):
...     '''Unreachable point'''
>>> raise RealityError
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
RealityError: Unreachable point

With argument:

>>> raise RealityError, "Outside handler"
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
RealityError: Unreachable point: Outside handler

Without docstring:

>>> class SomeError(RealityError):
...     pass    
>>> raise SomeError
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
SomeError

Without docstring, with argument:

>>> raise SomeError, 129
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
SomeError: 129
Instance Methods [hide private]
 
__str__(self)
str(x)
source code

Inherited from exceptions.Exception: __init__, __new__

Inherited from exceptions.BaseException: __delattr__, __getattribute__, __getitem__, __getslice__, __reduce__, __repr__, __setattr__, __setstate__

Inherited from object: __hash__, __reduce_ex__

Properties [hide private]

Inherited from exceptions.BaseException: args, message

Inherited from object: __class__

Method Details [hide private]

__str__(self)
(Informal representation operator)

source code 

str(x)

Overrides: object.__str__
(inherited documentation)