Skip to content

Commit 4bd4234

Browse files
authored
Merge pull request #202 from dbcli/llm-exception-handling
Llm exception handling
2 parents b8b65c8 + 16b47a3 commit 4bd4234

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
## 1.14.2 - 2025-01-26
2+
3+
### Bug Fixes
4+
5+
* Catch errors surfaced by `llm` cli and surface them as runtime errors.
6+
17
## 1.14.1 - 2025-01-25
28

39
### Bug Fixes

litecli/packages/special/llm.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,10 @@ def run_external_cmd(cmd, *args, capture_output=False, restart_cli=False, raise_
4848
except SystemExit as e:
4949
code = e.code
5050
if code != 0 and raise_exception:
51-
raise
51+
if capture_output:
52+
raise RuntimeError(buffer.getvalue())
53+
else:
54+
raise RuntimeError(f"Command {cmd} failed with exit code {code}.")
5255

5356
if restart_cli and code == 0:
5457
os.execv(original_exe, [original_exe] + original_args)

0 commit comments

Comments
 (0)