Skip to content

The agent engineering platform.

fix(cli): handle exception in remove() (#31982)

Michael Li5a4c0c08161b
diff --git a/libs/cli/langchain_cli/namespaces/app.py b/libs/cli/langchain_cli/namespaces/app.py
index 01ec78885b..35f61d6153 100644
--- a/libs/cli/langchain_cli/namespaces/app.py
+++ b/libs/cli/langchain_cli/namespaces/app.py
@@ -334,8 +334,8 @@ def remove(
shutil.rmtree(package_dir)
remove_deps.append(api_path)
- except Exception: # noqa: S110
- pass
+ except OSError as exc:
+ typer.echo(f"Failed to remove {api_path}: {exc}")
try:
remove_dependencies_from_pyproject_toml(project_pyproject, remove_deps)