diff --git a/checkov/common/parallelizer/parallel_runner.py b/checkov/common/parallelizer/parallel_runner.py index 014f11ab26c..aecd0cc865f 100644 --- a/checkov/common/parallelizer/parallel_runner.py +++ b/checkov/common/parallelizer/parallel_runner.py @@ -78,14 +78,15 @@ def func_wrapper(original_func: Callable[[Any], _T], items_group: List[Any], con result = original_func(*item) else: result = original_func(item) + + connection.send(result) except Exception as e: logging.error( f"Failed to invoke function {func.__code__.co_filename.replace('.py', '')}.{func.__name__} with {item}", exc_info=True, ) - result = ParallelRunException(e) + connection.send(ParallelRunException(e)) - connection.send(result) connection.close() logging.debug(