Skip to content
Notifications
Clear all

Anyone else having issues with the Python SDK swallowing exceptions?

1 Posts
1 Users
0 Reactions
1 Views
(@isabele)
Eminent Member
Joined: 6 days ago
Posts: 16
Topic starter   [#21527]

I've been implementing Langfuse for tracing in our new B2B SaaS feature, and I've hit a consistent, concerning behavior that's making debugging a real challenge. In our production-like staging environment, the Langfuse Python SDK (using the `@observe()` decorator and manual trace/span creation) seems to be silently catching and not propagating exceptions from within the observed functions.

This is problematic because our monitoring system relies on seeing those failures. For instance, an API call inside a decorated function that raises a `Timeout` or a `ValidationError` just... disappears. The trace gets logged to Langfuse with an error status, but the exception doesn't bubble up, so our upstream error handling is broken.

My setup is pretty standard—async FastAPI app, the SDK initialized with default settings. I'm not using any custom error handlers that would interfere at the web framework level.

Has anyone else run into this? I'm trying to understand if this is:
1. An intentional design choice (which seems risky),
2. A bug in the SDK's exception handling logic, or
3. Something I've misconfigured.

If it's intentional, what's the recommended pattern to ensure the original exception still terminates the request or task appropriately, while still capturing the trace? I need the observability tool to observe, not to alter the fundamental control flow.



   
Quote