Package yagdoc :: Module common :: Class DataError
[show private | hide private]
[frames | no frames]

Type DataError

   object --+        
            |        
BaseException --+    
                |    
        Exception --+
                    |
                   DataError

Known Subclasses:
DocBlockError, DocBookException, LinkerError, ParserError, ScannerError, TokenizerError

A recoverable error in input data.

This is a base class for such errors and must be always subclassed.

The docstring of the subclass serves as the primary error message. It should form an unterminated sentence.

Sometimes exceptions of this type are actually raised, but more often they are not; they are just created and stored somewhere. Particularly, they must not leak unhandled to user code (because the error is recoverable) and user code does not need to catch them.

It is based on Exception instead of UserWarning to avoid meddling of the warnings module.
Method Summary
  __init__(self, filename, line, detail, column)
Create a new input data error.
str format_gcc(self)
Format error into a GCC-style message.
Inherited from Exception: __new__
Inherited from BaseException: __delattr__, __getattribute__, __getitem__, __reduce__, __repr__, __setattr__, __setstate__, __str__
Inherited from object: __hash__, __reduce_ex__

Instance Variable Summary
int column: Input column number the error was noticed at, optional.
str detail: Error details, optional.
str filename: File the error occured in.
int line: Input line number the error was noticed at.

Class Variable Summary
Inherited from BaseException: args, message

Method Details

__init__(self, filename, line, detail=None, column=None)
(Constructor)

Create a new input data error.
Parameters:
filename - filename field.
line - line field.
detail - detail field.
column - column field.
Overrides:
exceptions.Exception.__init__

format_gcc(self)

Format error into a GCC-style message.

Subclass can override this method and add optional arguments (this would be impossible with __str__).
Returns:
GCC-style formatted error message. It includes the terminating '\n' and it can be multi-line.
           (type=str)

Instance Variable Details

column

Input column number the error was noticed at, optional. Column numbers start from 0, as elsewhere in yagdoc.
Type:
int

detail

Error details, optional.
Type:
str

filename

File the error occured in. This should be always set, most classes keep an attribute source or similar to track the input file.
Type:
str

line

Input line number the error was noticed at. This should be always set. Line numbers start from 0, as elsewhere in yagdoc.
Type:
int

Generated by Epydoc 2.1 on Fri Oct 5 00:36:53 2007 http://epydoc.sf.net