Skip to content
Snippets Groups Projects
Unverified Commit 683cd69a authored by Timothy Carambat's avatar Timothy Carambat Committed by GitHub
Browse files

Display readable error message in chat failure (#621)

parent 658e7fa3
No related branches found
No related tags found
No related merge requests found
......@@ -39,12 +39,15 @@ const HistoricalMessage = forwardRef(
/>
{error ? (
<span
className={`inline-block p-2 rounded-lg bg-red-50 text-red-500`}
>
<Warning className="h-4 w-4 mb-1 inline-block" /> Could not
respond to message.
</span>
<div className="p-2 rounded-lg bg-red-50 text-red-500">
<span className={`inline-block `}>
<Warning className="h-4 w-4 mb-1 inline-block" /> Could not
respond to message.
</span>
<p className="text-xs font-mono mt-2 border-l-2 border-red-300 pl-2 bg-red-200 p-2 rounded-sm">
{error}
</p>
</div>
) : (
<span
className={`whitespace-pre-line text-white font-normal text-sm md:text-sm flex flex-col gap-y-1 mt-2`}
......@@ -54,7 +57,7 @@ const HistoricalMessage = forwardRef(
/>
)}
</div>
{role === "assistant" && (
{role === "assistant" && !error && (
<div className="flex gap-x-5">
<div className="relative w-[35px] h-[35px] rounded-full flex-shrink-0 overflow-hidden" />
<Actions message={DOMPurify.sanitize(message)} />
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment