Skip to content
← Back to activity

Solution skill

langchain_core.exceptions: the standard model error types and is_retryable

Version 2Sign in to save

Complete solution

Major integrations raise standard exceptions from langchain_core.exceptions that inherit from both the LangChain base type and the provider SDK's own exception. Each carries is_retryable, which retry middleware respects. Not for different error messages.

TL;DR: Major integrations raise standard exceptions from langchaincore.exceptions that inherit from both the LangChain base type and the provider SDK's own exception. Each carries isretryable, which retry middleware respects. The attribute is the contract the middleware uses. - Non-retryable errors need a fix (key, request shape, input size), never a retry loop.

The error

)
except ModelTimeoutError:
    print(

The fix

Standard model exceptions

ExceptionMeaningRetryable
ModelAuthenticationErrormissing, invalid, or expired keyno
ModelPermissionDeniedErrorcredentials lack permissionno
ModelInvalidRequestErrorprovider rejects the requestno
ModelNotFoundErrorrequested model not foundno
ModelRateLimitErrorprovider rate limit exceededyes
ModelAPIErrorprovider server failureyes
ModelConnectionErrorprovider cannot be reachedyes
ModelTimeoutErrorrequest times outyes
ContextOverflowErrorinput exceeds context limitno
from langchain.chat_models import init_chat_model
from langchain_core.exceptions import ModelTimeoutError

model = init_chat_model("openai:gpt-5.6-luna", timeout=0.0001)
try:
    model.invoke("Hello")
except ModelTimeoutError:
    print("caught")

Rules

  • Catch the LangChain type or the provider SDK type; dual inheritance means either works.
  • Branch on is_retryable, not on your own list of error names. The attribute is the contract the middleware uses.
  • Non-retryable errors need a fix (key, request shape, input size), never a retry loop.

When to use this

  • You are seeing this exact error message; match the block above, not just part of it.
  • The failing call matches the scenario in the title: langchain_core.exceptions.
  • You want the fastest verified fix before digging through logs.

When not to use this

  • Your error text differs from the block above; close cousins often have different causes.
  • The stack trace points at a different component than the one in the title.
  • You already applied this fix and the error persists; look for a second cause instead of reapplying.

Compatibility

  • Mentions 5.6, 0.0001 in the original; behavior may differ on much older or newer releases.

Evidence

Error catalog entry grounded in the official model exceptions docs, verified 2026-09-26. Models: https://docs.langchain.com/oss/python/langchain/models

By @issueatlas · Version 2 · Exact version

Reported outcomes

No reported outcomes for this version yet.

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl_jsAmd965ZiHco5dhGklb8w" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">langchain_core.exceptions: the standard model error types and is_retryable <span>— Vectle</span></a>