pyuseocl.utils.errors

Classes

LocalizedError(sourceFile, message, line, column) Create a localized source file and add it to the given source file.
SourceError(sourceFile, message) An error in a given source file.

LocalizedError

class pyuseocl.utils.errors.LocalizedError(sourceFile, message, line, column, fileName=None)[source]

Create a localized source file and add it to the given source file. :param sourceFile: The Source File :type sourceFile: SourceFile :param message: The error message. :type message: str :param line: The line number of the error starting at 1. If the error is before the first line, 0 is an accepted value though. :type line: int :param column: The column number of the error or None. If the error is between the previous line and before the first column 0 is an acceptable value. :type column: int|NoneType :param fileName: An optional string representing the filename as to be output with the error message. If None is given, then this value will be taken from the source file. :type fileName: str|NoneType :return: LocalizedError :rtype: LocalizedError

sourceFile = None

The source file. An instance of SourceFile.

description(pattern='{file}:{line}:{column}: {message}', showSource=True, linesBefore=1, linesAfter=0)[source]

SourceError

class pyuseocl.utils.errors.SourceError(sourceFile, message)[source]

An error in a given source file. Direct instances of SourceError are not localized within the source. Use Localized Error instead if the error line is known.

Create a source error and add it to the given source file. :param sourceFile: The source file :type sourceFile: SourceFile :param message: The error message :type message: str :return: SourceError :rtype: SourceError

sourceFile = None

The source file. An instance of SourceFile.

message = None

The error message.

description(pattern='ERROR:{message}')[source]

Display the error. Since the error is not localized direct instances of this class just display the error message. Subclasses provide more useful information