Skip to content

Commit

Permalink
lestarch: prints missing fpp error(s) in generate (#1743)
Browse files Browse the repository at this point in the history
  • Loading branch information
LeStarch authored Oct 28, 2022
1 parent 0444a02 commit cdc452b
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion cmake/autocoder/fpp-wrapper/fpp-depend-parallelize.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -16,14 +24,17 @@ def run_process(directory, arguments):
stdin=subprocess.DEVNULL,
stdout=capture_file,
stderr=subprocess.PIPE,
text=True,
)


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):
Expand Down

0 comments on commit cdc452b

Please sign in to comment.