improved subprocess cmd logging

This commit is contained in:
Maxim Devaev
2022-06-19 20:56:51 +03:00
parent 0edf854832
commit 43da6af153
5 changed files with 8 additions and 6 deletions

View File

@@ -83,7 +83,8 @@ class Plugin(BaseUserGpioDriver): # pylint: disable=too-many-instance-attribute
if proc.returncode != 0:
raise RuntimeError(f"Custom command error: retcode={proc.returncode}")
except Exception as err:
get_logger(0).error("Can't run custom command %s: %s", self.__cmd, tools.efmt(err))
get_logger(0).error("Can't run custom command [ %s ]: %s",
tools.cmdfmt(self.__cmd), tools.efmt(err))
raise GpioDriverOfflineError(self)
def __str__(self) -> str: