LangChain Reference home pageLangChain ReferenceLangChain Reference
  • GitHub
  • Main Docs
Deep Agents
LangChain
LangGraph
Integrations
LangSmith
  • Overview
  • Client
  • AsyncClient
  • Run Helpers
  • Run Trees
  • Evaluation
  • Schemas
  • Utilities
  • Wrappers
  • Anonymizer
  • Testing
  • Expect API
  • Middleware
  • Pytest Plugin
  • Deployment SDK
⌘I

Chat LangChain

What can I help with?

Enter to send·Shift+Enter new line

Menu

OverviewClientAsyncClientRun HelpersRun TreesEvaluationSchemasUtilitiesWrappersAnonymizerTestingExpect APIMiddlewarePytest PluginDeployment SDK
Language
Theme
Pythonlangsmithrun_treesrun_status_from_exception
Function●Since v0.16

run_status_from_exception

Copy
run_status_from_exception(
    exc: Optional[BaseException],
) -> Optional[RunEndStatus]
View source on GitHub

Return the explicit status an exception asks to be traced with.

Only deliberate stops are marked: an exception (or, for CancelledError, its first argument) exposing ls_run_status of cancelled or interrupted (e.g. a class attribute set by the library that raises it). Anything else, including timeouts and unmarked CancelledError, returns None and stays an error; no exception class is recognized by name.