pydiffx.errors#
Common errors for parsing and generating diffs.
Exceptions
Base class for all DiffX errors. |
|
An error with content for a section. |
|
|
An error with the choice for a value for an option. |
An error with a value for an option. |
|
|
An error when parsing a DiffX file. |
An error with the order of a section within the DiffX file. |
|
An option name is unknown for a given section. |
|
|
Error with the contents of a hunk in a patch. |
- exception pydiffx.errors.DiffXParseError(msg, linenum, column=None)#
Bases:
BaseDiffXError
An error when parsing a DiffX file.
Parse errors contain information on the line (and sometimes the column) causing parsing to fail, along with an error message.
- column#
The 0-based column number where the parse error occurred. This may be
None
for some parse errors.- Type
- __init__(msg, linenum, column=None)#
Initialize the error.
- exception pydiffx.errors.DiffXSectionOrderError#
Bases:
BaseDiffXError
An error with the order of a section within the DiffX file.
- exception pydiffx.errors.DiffXContentError#
Bases:
BaseDiffXError
An error with content for a section.
- exception pydiffx.errors.DiffXUnknownOptionError#
Bases:
BaseDiffXError
An option name is unknown for a given section.
- exception pydiffx.errors.DiffXOptionValueError#
Bases:
BaseDiffXError
An error with a value for an option.
- exception pydiffx.errors.DiffXOptionValueChoiceError(option, value, choices)#
Bases:
DiffXOptionValueError
An error with the choice for a value for an option.
- exception pydiffx.errors.MalformedHunkError(line, line_num, msg=None)#
Bases:
Exception
Error with the contents of a hunk in a patch.
- __init__(line, line_num, msg=None)#
Initialize the error.
- Parameters
line (
bytes
) – The contents of the line triggering the error.line_num (
int
) – The 1-based line number where the error occurred.msg (
unicode
, optional) – An optional error message to display instead of the default message. This may containline
andline_num
format strings (built for%
-based formatting).
- __eq__(other)#
Return whether this exception equals another.
- __hash__ = None#