Skip to content

Commit a94ed24

Browse files
fix: fix exception to prevent swallowing unexpected errors
1 parent 56d6d69 commit a94ed24

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

libs/cli/langchain_cli/utils/events.py

Lines changed: 4 additions & 2 deletions
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,5 @@ def create_events(events: list[EventDict]) -> Optional[Any]:
3739
res = conn.getresponse()
3840

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

0 commit comments

Comments
 (0)