Skip to content

Commit

Permalink
Merge pull request dbcli#202 from dbcli/llm-exception-handling
Browse files Browse the repository at this point in the history
Llm exception handling
  • Loading branch information
amjith authored Jan 26, 2025
2 parents b8b65c8 + 16b47a3 commit 4bd4234
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
5 changes: 4 additions & 1 deletion litecli/packages/special/llm.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 4bd4234

Please sign in to comment.