diff --git a/ntd2d/entrypoint.py b/ntd2d/entrypoint.py index 01874a1..bb6df43 100755 --- a/ntd2d/entrypoint.py +++ b/ntd2d/entrypoint.py @@ -63,12 +63,14 @@ def main(): if __name__ == "__main__": try: - main() - except (subprocess.CalledProcessError, subprocess.TimeoutExpired) as e: - gha_utils.echo(f"what is happening?", use_subprocess=True) - gha_utils.echo(f"stdout: {e.stdout.decode('utf-8')[:1000]}", use_subprocess=True) - gha_utils.echo(f"stderr: {e.stderr.decode('utf-8')[:1000]}", use_subprocess=True) - sys.exit(1) + try: + main() + except (subprocess.CalledProcessError, subprocess.TimeoutExpired) as e: + if e.stdout is not None: + gha_utils.echo(f"stdout: {e.stdout.decode('utf-8')}", use_subprocess=True) + if e.stderr is not None: + gha_utils.echo(f"stderr: {e.stderr.decode('utf-8')}", use_subprocess=True) + raise except Exception as e: gha_utils.error("".join(traceback.format_exception(e)), use_subprocess=True) sys.exit(1)