chore: use error hint

This commit is contained in:
bholmesdev 2023-03-02 13:53:46 -05:00
parent c876d3fee3
commit 76cc6a1212

View file

@ -32,7 +32,6 @@ export function createAstroNode(
if (isCapitalized(node.name) && node.name in components) {
const component = components[node.name];
const props = node.attributes;
const children = node.children.map((child) => createAstroNode(child, components));
return {
@ -41,11 +40,10 @@ export function createAstroNode(
children,
};
} else if (isCapitalized(node.name)) {
throw new Error(
`[Markdoc] Unable to render ${JSON.stringify(
node.name
)}. Did you add this to the "components" prop on your <Content /> component?`
);
throw new MarkdocError({
message: `Unable to render ${JSON.stringify(node.name)}.`,
hint: 'Did you add this to the "components" prop on your <Content /> component?',
});
} else {
return {
tag: node.name,