Skip to content

[Feature] Add onerr callback for submit#2015

Closed
Minh Hieu (hieusmiths) wants to merge 1 commit intolangchain-ai:mainfrom
hieusmiths:feat/add-onerr-cb-for-submit
Closed

[Feature] Add onerr callback for submit#2015
Minh Hieu (hieusmiths) wants to merge 1 commit intolangchain-ai:mainfrom
hieusmiths:feat/add-onerr-cb-for-submit

Conversation

@hieusmiths
Copy link
Contributor

Current Situation:
We are currently using the onError callback within useStream to handle all errors. However, this approach seems too generic and is primarily suitable for logging purposes rather than robust error handling.

Problem:
The generic error handling is not sufficient for user-facing scenarios where specific error conditions require particular user actions, such as retrying an operation.

Sample Use Case:

  • A user submits a request to initiate a stream.
  • The stream operation fails.
  • The application needs to display a specific error message to the user, along with an option to retry the operation.
  • No handle error, detect submit failed since internal submit using callback and don't throw the exeception

@changeset-bot
Copy link

changeset-bot bot commented Mar 2, 2026

⚠️ No Changeset found

Latest commit: 96ff9b2

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@christian-bromann

Thank you for raising the PR, we are currently working on new SDK packages to integrate in different frontend frameworks, see #2001. I will incorporate your PR in there manually.

@christian-bromann

Added to my branch. Will go ahead and close. Please follow the PR for updates on release. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants