mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-12 08:37:25 +02:00
fix(plugin-content-docs): fix error message context (error cause) when doc processing fails (#8234)
Co-authored-by: sebastienlorber <lorber.sebastien@gmail.com>
This commit is contained in:
parent
327158b085
commit
91b92fcd08
2 changed files with 40 additions and 15 deletions
|
@ -316,7 +316,7 @@ async function doProcessDocMetadata({
|
|||
};
|
||||
}
|
||||
|
||||
export function processDocMetadata(args: {
|
||||
export async function processDocMetadata(args: {
|
||||
docFile: DocFile;
|
||||
versionMetadata: VersionMetadata;
|
||||
context: LoadContext;
|
||||
|
@ -324,10 +324,12 @@ export function processDocMetadata(args: {
|
|||
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 as Error},
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue