Skip to content

Conversation

@christian-bromann
Copy link
Member

The section was missing examples.

@github-actions github-actions bot added langchain For docs changes to LangChain python For content related to the Python version of LangChain projects oss javascript labels Nov 25, 2025
@github-actions
Copy link
Contributor

Mintlify preview ID generated: preview-cbhand-1764049439-3312c89

"""Handle tool execution errors with custom messages."""
try:
return handler(request)
except Exception as e:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should have a comment saying something conceptually about what kind of errors need to be retried by an LLM.

There are at least 4 types of errors:

  1. network failures (should be handeled using tool retry middleware)
  2. incorrect tool implementation (should bubble up)
  3. llm invocation errors that arise from a schema mismatch -- already auto-handeled!
  4. llm invocation errors that happen somewhere inside the function (e.g., def execute_sql(sql: str) -> str was invoked with sql="hello world". sql is a string (so won't raise an exception from schema mismatch, but will raise an error later on due to the sql being invalid sql! <-- This is the only type of error that should be handled this way

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

Labels

javascript langchain For docs changes to LangChain oss python For content related to the Python version of LangChain projects

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants