Skip to content

Commit aa932d1

Browse files
committed
Throw an error for non-notebook embeds (for now)
1 parent b4c5214 commit aa932d1

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

src/core/jupyter/jupyter-embed.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ export function parseNotebookAddress(
9898
ids: resolveCellIds(hashResult[2]),
9999
};
100100
} else {
101-
return undefined;
101+
unsupportedEmbed(path);
102102
}
103103
}
104104

@@ -112,7 +112,7 @@ export function parseNotebookAddress(
112112
indexes: resolveRange(indexResult[2]),
113113
};
114114
} else {
115-
return undefined;
115+
unsupportedEmbed(path);
116116
}
117117
}
118118

@@ -122,10 +122,16 @@ export function parseNotebookAddress(
122122
path,
123123
};
124124
} else {
125-
return undefined;
125+
unsupportedEmbed(path);
126126
}
127127
}
128128

129+
function unsupportedEmbed(path: string) {
130+
throw new Error(
131+
`Unable to embed content from ${path}. Embedding currently only supports content from Juptyer Notebooks.`,
132+
);
133+
}
134+
129135
// Creates a placeholder that will later be replaced with
130136
// rendered notebook markdown. Note that the placeholder
131137
// must stipulate all the information required to generate the

0 commit comments

Comments
 (0)