Skip to content

Commit 093e83e

Browse files
committed
feat(langgraph): update troubleshooting deep link to new docs, add MISSING_CHECKPOINTER reference error
1 parent e8f5084 commit 093e83e

File tree

3 files changed

+17
-11
lines changed

3 files changed

+17
-11
lines changed

libs/langgraph/src/errors.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ export type BaseLangGraphErrorFields = {
77
| "GRAPH_RECURSION_LIMIT"
88
| "INVALID_CONCURRENT_GRAPH_UPDATE"
99
| "INVALID_GRAPH_NODE_RETURN_VALUE"
10+
| "MISSING_CHECKPOINTER"
1011
| "MULTIPLE_SUBGRAPHS"
1112
| "UNREACHABLE_NODE";
1213
};
@@ -19,7 +20,7 @@ export class BaseLangGraphError extends Error {
1920
constructor(message?: string, fields?: BaseLangGraphErrorFields) {
2021
let finalMessage = message ?? "";
2122
if (fields?.lc_error_code) {
22-
finalMessage = `${finalMessage}\n\nTroubleshooting URL: https://langchain-ai.github.io/langgraphjs/troubleshooting/errors/${fields.lc_error_code}/\n`;
23+
finalMessage = `${finalMessage}\n\nTroubleshooting URL: https://docs.langchain.com/oss/javascript/langgraph/${fields.lc_error_code}/\n`;
2324
}
2425
super(finalMessage);
2526
this.lc_error_code = fields?.lc_error_code;

libs/langgraph/src/interrupt.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,11 @@ export function interrupt<I = unknown, R = any>(value: I): R {
7373
}
7474

7575
const checkpointer: BaseCheckpointSaver = conf[CONFIG_KEY_CHECKPOINTER];
76-
if (!checkpointer) throw new GraphValueError("No checkpointer set");
76+
if (!checkpointer) {
77+
throw new GraphValueError("No checkpointer set", {
78+
lc_error_code: "MISSING_CHECKPOINTER",
79+
});
80+
}
7781

7882
// Track interrupt index
7983
const scratchpad: PregelScratchpad = conf[CONFIG_KEY_SCRATCHPAD];

libs/langgraph/src/pregel/index.ts

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -931,7 +931,9 @@ export class Pregel<
931931
const checkpointer =
932932
config.configurable?.[CONFIG_KEY_CHECKPOINTER] ?? this.checkpointer;
933933
if (!checkpointer) {
934-
throw new GraphValueError("No checkpointer set");
934+
throw new GraphValueError("No checkpointer set", {
935+
lc_error_code: "MISSING_CHECKPOINTER",
936+
});
935937
}
936938

937939
const checkpointNamespace: string =
@@ -991,7 +993,9 @@ export class Pregel<
991993
const checkpointer: BaseCheckpointSaver =
992994
config.configurable?.[CONFIG_KEY_CHECKPOINTER] ?? this.checkpointer;
993995
if (!checkpointer) {
994-
throw new GraphValueError("No checkpointer set");
996+
throw new GraphValueError("No checkpointer set", {
997+
lc_error_code: "MISSING_CHECKPOINTER",
998+
});
995999
}
9961000

9971001
const checkpointNamespace: string =
@@ -1065,7 +1069,9 @@ export class Pregel<
10651069
const checkpointer: BaseCheckpointSaver | undefined =
10661070
startConfig.configurable?.[CONFIG_KEY_CHECKPOINTER] ?? this.checkpointer;
10671071
if (!checkpointer) {
1068-
throw new GraphValueError("No checkpointer set");
1072+
throw new GraphValueError("No checkpointer set", {
1073+
lc_error_code: "MISSING_CHECKPOINTER",
1074+
});
10691075
}
10701076
if (supersteps.length === 0) {
10711077
throw new Error("No supersteps provided");
@@ -2038,12 +2044,7 @@ export class Pregel<
20382044
stream.push([ns ?? [], "custom", chunk]);
20392045
};
20402046

2041-
config.interrupt ??=
2042-
this.checkpointer != null
2043-
? interrupt
2044-
: () => {
2045-
throw new GraphValueError("No checkpointer set");
2046-
};
2047+
config.interrupt ??= interrupt;
20472048

20482049
const callbackManager = await getCallbackManagerForConfig(config);
20492050
const runManager = await callbackManager?.handleChainStart(

0 commit comments

Comments
 (0)