mirror of
https://github.com/langchain-ai/langgraphjs.git
synced 2026-07-22 17:15:25 -04:00
feat(langgraph): update troubleshooting deep link to new docs, add MISSING_CHECKPOINTER reference error (#1617)
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"@langchain/langgraph": patch
|
||||
---
|
||||
|
||||
Update troubleshooting link for common errors, add MISSING_CHECKPOINTER troubleshooting page
|
||||
@@ -7,6 +7,7 @@ export type BaseLangGraphErrorFields = {
|
||||
| "GRAPH_RECURSION_LIMIT"
|
||||
| "INVALID_CONCURRENT_GRAPH_UPDATE"
|
||||
| "INVALID_GRAPH_NODE_RETURN_VALUE"
|
||||
| "MISSING_CHECKPOINTER"
|
||||
| "MULTIPLE_SUBGRAPHS"
|
||||
| "UNREACHABLE_NODE";
|
||||
};
|
||||
@@ -19,7 +20,7 @@ export class BaseLangGraphError extends Error {
|
||||
constructor(message?: string, fields?: BaseLangGraphErrorFields) {
|
||||
let finalMessage = message ?? "";
|
||||
if (fields?.lc_error_code) {
|
||||
finalMessage = `${finalMessage}\n\nTroubleshooting URL: https://langchain-ai.github.io/langgraphjs/troubleshooting/errors/${fields.lc_error_code}/\n`;
|
||||
finalMessage = `${finalMessage}\n\nTroubleshooting URL: https://docs.langchain.com/oss/javascript/langgraph/${fields.lc_error_code}/\n`;
|
||||
}
|
||||
super(finalMessage);
|
||||
this.lc_error_code = fields?.lc_error_code;
|
||||
|
||||
@@ -73,7 +73,11 @@ export function interrupt<I = unknown, R = any>(value: I): R {
|
||||
}
|
||||
|
||||
const checkpointer: BaseCheckpointSaver = conf[CONFIG_KEY_CHECKPOINTER];
|
||||
if (!checkpointer) throw new GraphValueError("No checkpointer set");
|
||||
if (!checkpointer) {
|
||||
throw new GraphValueError("No checkpointer set", {
|
||||
lc_error_code: "MISSING_CHECKPOINTER",
|
||||
});
|
||||
}
|
||||
|
||||
// Track interrupt index
|
||||
const scratchpad: PregelScratchpad = conf[CONFIG_KEY_SCRATCHPAD];
|
||||
|
||||
@@ -931,7 +931,9 @@ export class Pregel<
|
||||
const checkpointer =
|
||||
config.configurable?.[CONFIG_KEY_CHECKPOINTER] ?? this.checkpointer;
|
||||
if (!checkpointer) {
|
||||
throw new GraphValueError("No checkpointer set");
|
||||
throw new GraphValueError("No checkpointer set", {
|
||||
lc_error_code: "MISSING_CHECKPOINTER",
|
||||
});
|
||||
}
|
||||
|
||||
const checkpointNamespace: string =
|
||||
@@ -991,7 +993,9 @@ export class Pregel<
|
||||
const checkpointer: BaseCheckpointSaver =
|
||||
config.configurable?.[CONFIG_KEY_CHECKPOINTER] ?? this.checkpointer;
|
||||
if (!checkpointer) {
|
||||
throw new GraphValueError("No checkpointer set");
|
||||
throw new GraphValueError("No checkpointer set", {
|
||||
lc_error_code: "MISSING_CHECKPOINTER",
|
||||
});
|
||||
}
|
||||
|
||||
const checkpointNamespace: string =
|
||||
@@ -1065,7 +1069,9 @@ export class Pregel<
|
||||
const checkpointer: BaseCheckpointSaver | undefined =
|
||||
startConfig.configurable?.[CONFIG_KEY_CHECKPOINTER] ?? this.checkpointer;
|
||||
if (!checkpointer) {
|
||||
throw new GraphValueError("No checkpointer set");
|
||||
throw new GraphValueError("No checkpointer set", {
|
||||
lc_error_code: "MISSING_CHECKPOINTER",
|
||||
});
|
||||
}
|
||||
if (supersteps.length === 0) {
|
||||
throw new Error("No supersteps provided");
|
||||
@@ -2038,12 +2044,7 @@ export class Pregel<
|
||||
stream.push([ns ?? [], "custom", chunk]);
|
||||
};
|
||||
|
||||
config.interrupt ??=
|
||||
this.checkpointer != null
|
||||
? interrupt
|
||||
: () => {
|
||||
throw new GraphValueError("No checkpointer set");
|
||||
};
|
||||
config.interrupt ??= interrupt;
|
||||
|
||||
const callbackManager = await getCallbackManagerForConfig(config);
|
||||
const runManager = await callbackManager?.handleChainStart(
|
||||
|
||||
Reference in New Issue
Block a user