Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(plugin-content-docs): fix error message context (error cause) when doc processing fails #8234

Merged
merged 7 commits into from Oct 26, 2022
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 3 additions & 4 deletions packages/docusaurus-plugin-content-docs/src/docs.ts
Expand Up @@ -316,18 +316,17 @@ async function doProcessDocMetadata({
};
}

export function processDocMetadata(args: {
export async function processDocMetadata(args: {
docFile: DocFile;
versionMetadata: VersionMetadata;
context: LoadContext;
options: MetadataOptions;
env: DocEnv;
}): Promise<DocMetadataBase> {
try {
return doProcessDocMetadata(args);
return await doProcessDocMetadata(args);
} catch (err) {
logger.error`Can't process doc metadata for doc at path path=${args.docFile.filePath} in version name=${args.versionMetadata.versionName}`;
throw err;
throw new Error(`Can't process doc metadata for doc at path path=${args.docFile.filePath} in version name=${args.versionMetadata.versionName}`, {cause: err});
shanpriyan marked this conversation as resolved.
Show resolved Hide resolved
}
}

Expand Down