mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-14 09:37:37 +02:00
fix(content-docs): give context about sidebar loading failure (#6887)
This commit is contained in:
parent
e842b40a54
commit
ff0d981853
1 changed files with 19 additions and 12 deletions
|
@ -98,16 +98,23 @@ export async function loadSidebars(
|
||||||
sidebarFilePath: string | false | undefined,
|
sidebarFilePath: string | false | undefined,
|
||||||
options: SidebarProcessorParams,
|
options: SidebarProcessorParams,
|
||||||
): Promise<Sidebars> {
|
): Promise<Sidebars> {
|
||||||
const sidebarsConfig = await loadSidebarsFileUnsafe(sidebarFilePath);
|
try {
|
||||||
const normalizedSidebars = normalizeSidebars(sidebarsConfig);
|
const sidebarsConfig = await loadSidebarsFileUnsafe(sidebarFilePath);
|
||||||
validateSidebars(normalizedSidebars);
|
const normalizedSidebars = normalizeSidebars(sidebarsConfig);
|
||||||
const categoriesMetadata = await readCategoriesMetadata(
|
validateSidebars(normalizedSidebars);
|
||||||
options.version.contentPath,
|
const categoriesMetadata = await readCategoriesMetadata(
|
||||||
);
|
options.version.contentPath,
|
||||||
const processedSidebars = await processSidebars(
|
);
|
||||||
normalizedSidebars,
|
const processedSidebars = await processSidebars(
|
||||||
categoriesMetadata,
|
normalizedSidebars,
|
||||||
options,
|
categoriesMetadata,
|
||||||
);
|
options,
|
||||||
return postProcessSidebars(processedSidebars, options);
|
);
|
||||||
|
return postProcessSidebars(processedSidebars, options);
|
||||||
|
} catch (err) {
|
||||||
|
logger.error`Sidebars file at path=${
|
||||||
|
sidebarFilePath as string
|
||||||
|
} failed to be loaded.`;
|
||||||
|
throw err;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue