Skip to content

armgit / letta

Public Imported from GitHub
0

Platform for stateful agents: AI with advanced memory that can learn and self-improve over time.

feat: error stack trace capture (#2203)

Sarah Wooders3d5c321d912c
diff --git a/letta/server/rest_api/app.py b/letta/server/rest_api/app.py
index 9b43495a2..321a48827 100644
--- a/letta/server/rest_api/app.py
+++ b/letta/server/rest_api/app.py
@@ -152,6 +152,10 @@ def create_application() -> "FastAPI":
# Print the stack trace
print(f"Stack trace: {exc.__traceback__}")
+ if (os.getenv("SENTRY_DSN") is not None) and (os.getenv("SENTRY_DSN") != ""):
+ import sentry_sdk
+
+ sentry_sdk.capture_exception(exc)
return JSONResponse(
status_code=500,