mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-15 18:17:35 +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,6 +98,7 @@ export async function loadSidebars(
|
||||||
sidebarFilePath: string | false | undefined,
|
sidebarFilePath: string | false | undefined,
|
||||||
options: SidebarProcessorParams,
|
options: SidebarProcessorParams,
|
||||||
): Promise<Sidebars> {
|
): Promise<Sidebars> {
|
||||||
|
try {
|
||||||
const sidebarsConfig = await loadSidebarsFileUnsafe(sidebarFilePath);
|
const sidebarsConfig = await loadSidebarsFileUnsafe(sidebarFilePath);
|
||||||
const normalizedSidebars = normalizeSidebars(sidebarsConfig);
|
const normalizedSidebars = normalizeSidebars(sidebarsConfig);
|
||||||
validateSidebars(normalizedSidebars);
|
validateSidebars(normalizedSidebars);
|
||||||
|
@ -110,4 +111,10 @@ export async function loadSidebars(
|
||||||
options,
|
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