mirror of
https://github.com/facebook/docusaurus.git
synced 2025-06-01 10:22:30 +02:00
fix(v2): DocNavbarItem error message (#4554)
* Fix DocNavbarItem error message * Clean code * clean code
This commit is contained in:
parent
9fceeb9ec5
commit
902aad55bb
1 changed files with 3 additions and 4 deletions
|
@ -27,11 +27,10 @@ export default function DocNavbarItem({
|
|||
|
||||
const doc = version.docs.find((versionDoc) => versionDoc.id === docId);
|
||||
if (!doc) {
|
||||
const docIds = version.docs.map((versionDoc) => versionDoc.id).join('\n- ');
|
||||
throw new Error(
|
||||
`DocNavbarItem: couldn't find any doc with id=${docId} in version ${
|
||||
version.name
|
||||
}.
|
||||
Available docIds=\n- ${version.docs.join('\n- ')}`,
|
||||
`DocNavbarItem: couldn't find any doc with id=${docId} in version ${version.name}.
|
||||
Available docIds=\n- ${docIds}`,
|
||||
);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue