From cdc452baa9080411749228e9573871be0f6e60ca Mon Sep 17 00:00:00 2001 From: M Starch Date: Fri, 28 Oct 2022 13:08:10 -0700 Subject: [PATCH] lestarch: prints missing fpp error(s) in generate (#1743) --- .../autocoder/fpp-wrapper/fpp-depend-parallelize.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/cmake/autocoder/fpp-wrapper/fpp-depend-parallelize.py b/cmake/autocoder/fpp-wrapper/fpp-depend-parallelize.py index cc75b9e40d..2bb45a71ce 100755 --- a/cmake/autocoder/fpp-wrapper/fpp-depend-parallelize.py +++ b/cmake/autocoder/fpp-wrapper/fpp-depend-parallelize.py @@ -5,6 +5,14 @@ from pathlib import Path +class ExceptionWithStandardError(Exception): + """Exception plus standard error""" + + def __init__(self, message, stderr): + message = f"{message}\n{stderr}" + super().__init__(message) + + def run_process(directory, arguments): """Runs the fpp-depend process""" working_dir = directory / "fpp-cache" @@ -16,6 +24,7 @@ def run_process(directory, arguments): stdin=subprocess.DEVNULL, stdout=capture_file, stderr=subprocess.PIPE, + text=True, ) @@ -23,7 +32,9 @@ def raise_on_error(process, arguments): """Waits for process, raises on error""" code = process.wait() if code != 0: - raise Exception(f"Failed to run '{' '.join(arguments)}'") + raise ExceptionWithStandardError( + f"Failed to run '{' '.join(arguments)}'", process.stderr.read() + ) def run_parallel_depend(fpp_depend, fpp_locs, file_input):