fix: print traceback on build failure

Build failures are hard to read, sometimes we get errors like:

```
Error building stack: 'key'
```

Which are difficult to debug without a proper trace.

Signed-off-by: Sébastien Han <seb@redhat.com>
This commit is contained in:
Sébastien Han 2025-04-16 13:10:17 +02:00
parent 83b5523e2d
commit 64d8cde4a0
No known key found for this signature in database

View file

@ -235,10 +235,14 @@ def run_stack_build_command(args: argparse.Namespace) -> None:
) )
except (Exception, RuntimeError) as exc: except (Exception, RuntimeError) as exc:
import traceback
cprint( cprint(
f"Error building stack: {exc}", f"Error building stack: {exc}",
color="red", color="red",
) )
cprint("Stack trace:", color="red")
traceback.print_exc()
sys.exit(1) sys.exit(1)
if run_config is None: if run_config is None:
cprint( cprint(