Ensure local exec errs have a meaningful error output

This commit is contained in:
jeanluc 2023-12-29 17:33:11 +01:00 committed by Daniel Wozniak
parent 1beb3eed45
commit 1d0dfdecbd

View file

@ -88,7 +88,10 @@ class SSHCommandExecutionError(SSHException, CommandExecutionError):
return super().to_ret()
def __str__(self):
return f"{self._error}: {self.stderr or self.stdout}"
ret = self.to_ret()
if not isinstance(ret, str):
ret = self.stderr or self.stdout
return f"{self._error}: {ret}"
class SSHPermissionDeniedError(SSHException):