LangChain Reference home pageLangChain ReferenceLangChain Reference
  • GitHub
  • Main Docs
Deep Agents
LangChain
LangGraph
Integrations
LangSmith
LangGraph
  • Web
  • Channels
  • Pregel
  • Prebuilt
  • Remote
  • Stream
LangGraph SDK
  • Ui
  • Client
  • Auth
  • React
  • Logging
  • React Ui
  • Utils
  • Server
  • Stream
LangGraph Checkpoint
LangGraph Checkpoint MongoDB
LangGraph Checkpoint Postgres
  • Store
LangGraph Checkpoint Redis
  • Shallow
  • Store
LangGraph Checkpoint SQLite
LangGraph Checkpoint Validation
  • Cli
LangGraph API
LangGraph CLI
LangGraph CUA
  • Utils
LangGraph Supervisor
LangGraph Swarm
⌘I

LangChain Assistant

Ask a question to get started

Enter to send•Shift+Enter new line

Menu

LangGraph
WebChannelsPregelPrebuiltRemoteStream
LangGraph SDK
UiClientAuthReactLoggingReact UiUtilsServerStream
LangGraph Checkpoint
LangGraph Checkpoint MongoDB
LangGraph Checkpoint Postgres
Store
LangGraph Checkpoint Redis
ShallowStore
LangGraph Checkpoint SQLite
LangGraph Checkpoint Validation
Cli
LangGraph API
LangGraph CLI
LangGraph CUA
Utils
LangGraph Supervisor
LangGraph Swarm
Language
Theme
JavaScript@langchain/langgraphwebNodeError
Classā—Since v0.3

NodeError

Failure context passed to a node-level error handler.

A node-level error handler is registered via StateGraph.addNode(name, fn, { errorHandler }). The handler runs ONLY after the failing node's RetryPolicy is exhausted, so retry and handling stay decoupled. The handler receives the failed node's name and the thrown error via a NodeError instance, can return a state update, and can route to a recovery branch via new Command({ goto }) (saga / compensation flows).

Copy
class NodeError

Used in Docs

  • Fault tolerance

Example

Copy
import { NodeError } from "@langchain/langgraph";

function handler(state: State, error: NodeError) {
  return new Command({
    update: { status: `recovered from ${error.node}: ${error.error.message}` },
    goto: "finalize",
  });
}

Constructors

constructor
constructor

Properties

property
error: Error

Error thrown by the failed node.

property
node: string

Name of the node whose execution failed.

property
unminifiable_name: string
View source on GitHub