diff --git a/CHANGELOG.md b/CHANGELOG.md index baeecd7..328261f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +## 1.14.2 - 2025-01-26 + +### Bug Fixes + +* Catch errors surfaced by `llm` cli and surface them as runtime errors. + ## 1.14.1 - 2025-01-25 ### Bug Fixes diff --git a/litecli/packages/special/llm.py b/litecli/packages/special/llm.py index f18495b..69375d7 100644 --- a/litecli/packages/special/llm.py +++ b/litecli/packages/special/llm.py @@ -48,7 +48,10 @@ def run_external_cmd(cmd, *args, capture_output=False, restart_cli=False, raise_ except SystemExit as e: code = e.code if code != 0 and raise_exception: - raise + if capture_output: + raise RuntimeError(buffer.getvalue()) + else: + raise RuntimeError(f"Command {cmd} failed with exit code {code}.") if restart_cli and code == 0: os.execv(original_exe, [original_exe] + original_args)