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:
BaseDiffXErrorAn 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
Nonefor some parse errors.- Type:
- __init__(msg, linenum, column=None)¶
Initialize the error.
- __annotations__ = {}¶
- exception pydiffx.errors.DiffXSectionOrderError¶
Bases:
BaseDiffXErrorAn error with the order of a section within the DiffX file.
- __annotations__ = {}¶
- exception pydiffx.errors.DiffXContentError¶
Bases:
BaseDiffXErrorAn error with content for a section.
- __annotations__ = {}¶
- exception pydiffx.errors.DiffXUnknownOptionError¶
Bases:
BaseDiffXErrorAn option name is unknown for a given section.
- __annotations__ = {}¶
- exception pydiffx.errors.DiffXOptionValueError¶
Bases:
BaseDiffXErrorAn error with a value for an option.
- __annotations__ = {}¶
- exception pydiffx.errors.DiffXOptionValueChoiceError(option, value, choices)¶
Bases:
DiffXOptionValueErrorAn error with the choice for a value for an option.
- __init__(option, value, choices)¶
Initialize the error.
- __annotations__ = {}¶
- exception pydiffx.errors.MalformedHunkError(line, line_num, msg=None)¶
Bases:
ExceptionError 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 containlineandline_numformat strings (built for%-based formatting).
- __eq__(other)¶
Return whether this exception equals another.
- __hash__ = None¶