Skip to content

Commit 35bee7a

Browse files
committed
output error messages with Syntax highlighting
1 parent 3bbd8f1 commit 35bee7a

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

frontend/src/components/Chat.tsx

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,25 @@ function Message(props: {
5353
<div className="cell-output" dangerouslySetInnerHTML={{ __html: text }}></div>
5454
))}
5555

56-
{(["message_raw", "message_error"].indexOf(props.type) !== -1) &&
56+
{props.type == "message_error" &&
57+
(props.showLoader ? (
58+
<div>
59+
{text} {props.showLoader ? <div className="loader"></div> : null}
60+
</div>
61+
) : (
62+
<div>
63+
Execution Error:
64+
<SyntaxHighlighter
65+
{...props}
66+
children={text}
67+
wrapLongLines={true}
68+
language={"python"}
69+
PreTag="div"
70+
/>
71+
</div>
72+
))}
73+
74+
{props.type == "message_raw" &&
5775
(props.showLoader ? (
5876
<div>
5977
{text} {props.showLoader ? <div className="loader"></div> : null}

0 commit comments

Comments
 (0)