Skip to content

Commit

Permalink
fix: render error descriptions (#1598)
Browse files Browse the repository at this point in the history
  • Loading branch information
abvthecity authored Oct 7, 2024
1 parent 6801d8a commit ff18419
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { FernCollapse } from "@fern-ui/components";
import { titleCase, visitDiscriminatedUnion } from "@fern-ui/core-utils";
import cn from "clsx";
import { MouseEventHandler, memo } from "react";
import { MdxContent } from "../../mdx/MdxContent";
import {
ResolvedError,
ResolvedTypeDefinition,
Expand Down Expand Up @@ -73,7 +74,10 @@ export const EndpointError = memo<EndpointError.Props>(function EndpointErrorUnm
<FernCollapse open={isSelected} className="w-full">
<div className="space-y-2 pt-2">
<div className="t-muted w-full text-start text-sm leading-7">
{`This error return ${renderDeprecatedTypeShorthand(error.shape, { withArticle: true }, types)}.`}
<MdxContent
mdx={error.description}
fallback={`This error return ${renderDeprecatedTypeShorthand(error.shape, { withArticle: true }, types)}.`}
/>
</div>
{shouldHideShape(error.shape, types) ? null : (
<div className="w-full text-start">
Expand Down

0 comments on commit ff18419

Please sign in to comment.