forked from clan/clan-core
Improved error message. Fixed incorrect ret code check in git.py
This commit is contained in:
parent
64846eb395
commit
359275eee7
@ -9,6 +9,18 @@ class CmdOut(NamedTuple):
|
||||
command: str
|
||||
returncode: int
|
||||
|
||||
def __str__(self) -> str:
|
||||
return f"""
|
||||
Working Directory: '{self.cwd}'
|
||||
Return Code: {self.returncode}
|
||||
=================== Command ===================
|
||||
{self.command}
|
||||
=================== STDERR ===================
|
||||
{self.stderr}
|
||||
=================== STDOUT ===================
|
||||
{self.stdout}
|
||||
"""
|
||||
|
||||
|
||||
class ClanError(Exception):
|
||||
"""Base class for exceptions in this module."""
|
||||
@ -32,3 +44,9 @@ class ClanCmdError(ClanError):
|
||||
def __init__(self, cmd: CmdOut) -> None:
|
||||
self.cmd = cmd
|
||||
super().__init__()
|
||||
|
||||
def __str__(self) -> str:
|
||||
return str(self.cmd)
|
||||
|
||||
def __repr__(self) -> str:
|
||||
return f"ClanCmdError({self.cmd})"
|
||||
|
Loading…
Reference in New Issue
Block a user