gitutils.giterror
: Errors for gitutils
Git repo tools¶
This module provides a collection of error types relevant to the
gitutils
package. They are essentially the same as standard error
types such as KeyError
, TypeError
, etc. but with an
extra parent of GitutilsError
to enable catching all errors
specifically raised by this package
- exception lfc._vendor.gitutils.giterror.GitutilsAttributeError¶
Error related to accessing attributes of
OptionsDict
Inherits from
AttributeError
andGitutilsError
.
- exception lfc._vendor.gitutils.giterror.GitutilsError¶
Parent error class for
gitutils
errorsInherits from
Exception
- exception lfc._vendor.gitutils.giterror.GitutilsExprError¶
Exception for invalid
@expr
Applies to
Gitutils.optitem.getel()
orOptionsDict
- exception lfc._vendor.gitutils.giterror.GitutilsFileNotFoundError¶
Exception for missing but required file
Inherits from
FileNotFoundError
and :class;`GitutilsError`
- exception lfc._vendor.gitutils.giterror.GitutilsJSONError¶
Exception class for errors while parsing JSON files
Inherits from
ValueError
andGitutilsError
- exception lfc._vendor.gitutils.giterror.GitutilsKeyError¶
Exception for missing key in
gitutils
Inherits from
KeyError
andGitutilsError
- exception lfc._vendor.gitutils.giterror.GitutilsNameError¶
Error for badly named options in
OptionsDict
Inherits from
NameError
andGitutilsError
- exception lfc._vendor.gitutils.giterror.GitutilsSystemError¶
Exception for system errors raised by
gitutils
- exception lfc._vendor.gitutils.giterror.GitutilsTypeError¶
Exception for unexpected type of parameter in
Gitutils
- exception lfc._vendor.gitutils.giterror.GitutilsValueError¶
Exception for unexpected value of parameter in
Gitutils
- lfc._vendor.gitutils.giterror.assert_isfile(fname: str)¶
Ensure that a file exists
- Call:
>>> assert_isfile(fname)
- Inputs:
- fname:
str
Name of a file
- fname:
- Raises:
GitutilsFileNotFoundError
if fname does not exist- Versions:
2023-10-25
@ddalle
: v1.0
- lfc._vendor.gitutils.giterror.assert_isinstance(obj, cls_or_tuple, desc=None)¶
Conveniently check types
Applies
isinstance(obj, cls_or_tuple)
but also constructs a :class;`TypeError` and appropriate message if test fails- Call:
>>> assert_isinstance(obj, cls, desc=None) >>> assert_isinstance(obj, cls_tuple, desc=None)
- Inputs:
- Raises:
- Versions:
2022-09-17
@ddalle
: Version 1.0