Skip to content

Commit 12d370a

Browse files
fix(cli): exception to prevent swallowing unexpected errors (#31983)
1 parent 5a4c0c0 commit 12d370a

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

libs/cli/langchain_cli/utils/events.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
import json
33
from typing import Any, Optional, TypedDict
44

5+
import typer
6+
57
WRITE_KEY = "310apTK0HUFl4AOv"
68

79

@@ -37,5 +39,6 @@ def create_events(events: list[EventDict]) -> Optional[Any]:
3739
res = conn.getresponse()
3840

3941
return json.loads(res.read())
40-
except Exception:
42+
except (http.client.HTTPException, OSError, json.JSONDecodeError) as exc:
43+
typer.echo(f"Error sending events: {exc}")
4144
return None

0 commit comments

Comments
 (0)