From 173af4e4595a3660addb0910adcaef5eaaaf90c2 Mon Sep 17 00:00:00 2001 From: Enrico Ros Date: Sun, 16 Jun 2024 18:44:09 -0700 Subject: [PATCH] Bits --- src/common/components/InlineError.tsx | 4 ++-- src/modules/blocks/code/RenderCode.tsx | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/common/components/InlineError.tsx b/src/common/components/InlineError.tsx index 64d83c38b..b4fa68f35 100644 --- a/src/common/components/InlineError.tsx +++ b/src/common/components/InlineError.tsx @@ -1,9 +1,9 @@ import * as React from 'react'; +import type { SxProps } from '@mui/joy/styles/types'; import { Alert, Typography } from '@mui/joy'; -import { SxProps } from '@mui/joy/styles/types'; -export function InlineError(props: { error: React.JSX.Element | null | any, severity?: 'warning' | 'danger' | 'info', sx?: SxProps }) { +export function InlineError(props: { error: Error | React.JSX.Element | null | any, severity?: 'warning' | 'danger' | 'info', sx?: SxProps }) { const color = props.severity === 'info' ? 'primary' : props.severity || 'warning'; return ( diff --git a/src/modules/blocks/code/RenderCode.tsx b/src/modules/blocks/code/RenderCode.tsx index fd8b827da..59d46e33d 100644 --- a/src/modules/blocks/code/RenderCode.tsx +++ b/src/modules/blocks/code/RenderCode.tsx @@ -214,7 +214,7 @@ function RenderCodeImpl(props: RenderCodeImplProps) { renderSVG ? (patchSvgString(fitScreen, blockCode) || 'No SVG code') : renderPlantUML - ? (patchSvgString(fitScreen, plantUmlHtmlData) || (plantUmlError as string) || 'No PlantUML rendering.') + ? (patchSvgString(fitScreen, plantUmlHtmlData) || (plantUmlError ? `PlantUML Error: ${plantUmlError.message}` : 'No PlantUML code')) : highlightedCode, }} sx={{