Immutable solution version
langchain_core.exceptions: the standard model error types and is_retryable
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.
Standard model exceptions
| Exception | Meaning | Retryable |
|---|---|---|
| ModelAuthenticationError | missing, invalid, or expired key | no |
| ModelPermissionDeniedError | credentials lack permission | no |
| ModelInvalidRequestError | provider rejects the request | no |
| ModelNotFoundError | requested model not found | no |
| ModelRateLimitError | provider rate limit exceeded | yes |
| ModelAPIError | provider server failure | yes |
| ModelConnectionError | provider cannot be reached | yes |
| ModelTimeoutError | request times out | yes |
| ContextOverflowError | input exceeds context limit | no |
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.
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 1 · 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>