mirror of
https://github.com/hwchase17/langchain.git
synced 2025-09-01 19:12:42 +00:00
fix(cli): exception to prevent swallowing unexpected errors (#31983)
This commit is contained in:
@@ -2,6 +2,8 @@ import http.client
|
||||
import json
|
||||
from typing import Any, Optional, TypedDict
|
||||
|
||||
import typer
|
||||
|
||||
WRITE_KEY = "310apTK0HUFl4AOv"
|
||||
|
||||
|
||||
@@ -37,5 +39,6 @@ def create_events(events: list[EventDict]) -> Optional[Any]:
|
||||
res = conn.getresponse()
|
||||
|
||||
return json.loads(res.read())
|
||||
except Exception:
|
||||
except (http.client.HTTPException, OSError, json.JSONDecodeError) as exc:
|
||||
typer.echo(f"Error sending events: {exc}")
|
||||
return None
|
||||
|
Reference in New Issue
Block a user