mirror of
https://github.com/hanzo-docs/docs.git
synced 2026-10-26 23:49:51 +00:00
OpenAPI: improve error messages
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'fumadocs-openapi': patch
|
||||
---
|
||||
|
||||
Improve error message
|
||||
@@ -49,7 +49,13 @@ export async function processDocument(
|
||||
throw new Error(`Failed to resolve ${node.$ref}`);
|
||||
},
|
||||
},
|
||||
}).then((v) => upgrade(v).specification);
|
||||
})
|
||||
.then((v) => upgrade(v).specification)
|
||||
.catch((e) => {
|
||||
throw new Error(`[OpenAPI] Failed to resolve input: ${input}`, {
|
||||
cause: e,
|
||||
});
|
||||
});
|
||||
|
||||
/**
|
||||
* Dereferenced value and its original `$ref` value
|
||||
|
||||
@@ -200,8 +200,9 @@ function NavbarLinkItem({
|
||||
|
||||
if (item.type === 'menu') {
|
||||
const children = item.items.map((child, j) => {
|
||||
if (child.type === 'custom')
|
||||
if (child.type === 'custom') {
|
||||
return <Fragment key={j}>{child.children}</Fragment>;
|
||||
}
|
||||
|
||||
const {
|
||||
banner = child.icon ? (
|
||||
@@ -214,7 +215,7 @@ function NavbarLinkItem({
|
||||
|
||||
return (
|
||||
<NavbarMenuLink
|
||||
key={j}
|
||||
key={`${j}-${child.url}`}
|
||||
href={child.url}
|
||||
external={child.external}
|
||||
{...rest}
|
||||
|
||||
Reference in New Issue
Block a user