-
Notifications
You must be signed in to change notification settings - Fork 163
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
streamEvents with for await loop within try catch does not work #812
Closed
Comments
Hmm weird - will dig in, thanks for reporting |
When I run it it just hangs - that's what you're seeing too right? |
Think I have a fix! Will ship tomorrow in |
Can you bump to |
Thanks @jacoblee93 ! just verified it is fixed. Thanks for the quick fix and release! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi team, I have wasted a tons of time to figure out error messages were swallowed somewhere and finally figured for loop with the streamEvents swallows errors.
This is code to reproduce the issue. I simply copy and pasted from the example in https://langchain-ai.github.io/langgraphjs/concepts/streaming/#streaming-llm-tokens-and-events-streamevents
as you can see the code, the error "This should be caught" should be caught in the catch block, but when I run the code, it won't.
by the way this also happens with langchain as well.
Test env:
"@langchain/core": "^0.3.27",
"@langchain/langgraph": "^0.2.39",
"@langchain/openai": "^0.3.16",
For fix, I just catch inside the for await loop, handle the error. But ideally it should catch the error from outside try catch.
The text was updated successfully, but these errors were encountered: