Skip to content

Class peagen.errors.GitCommitError

peagen.errors.GitCommitError

GitCommitError(paths, reason=None)

Bases: GitOperationError

Raised when committing changes to the repository fails.

Source code in peagen/errors.py
124
125
126
127
128
129
130
def __init__(self, paths: Iterable[str], reason: str | None = None) -> None:
    joined = ", ".join(paths)
    base = f"Failed to commit files [{joined}]. Ensure they exist inside the repository."
    msg = f"{base} Details: {reason}" if reason else base
    super().__init__(msg)
    self.paths = list(paths)
    self.reason = reason

paths instance-attribute

paths = list(paths)

reason instance-attribute

reason = reason