fix(v2): DocNavbarItem error message (#4554)

* Fix DocNavbarItem error message

* Clean code

* clean code
This commit is contained in:
serut 2021-04-02 17:07:41 +02:00 committed by GitHub
parent 9fceeb9ec5
commit 902aad55bb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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}`,
);
}