We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 22de923 commit 988b915Copy full SHA for 988b915
components/message.tsx
@@ -176,6 +176,19 @@ const PurePreviewMessage = ({
176
const widthClass = "w-[min(100%,450px)]";
177
178
if (state === "output-available") {
179
+ const output = part.output as any;
180
+
181
+ if (output && "error" in output) {
182
+ return (
183
+ <div
184
+ className="rounded-lg border border-red-200 bg-red-50 p-4 text-red-500 dark:bg-red-950/50"
185
+ key={toolCallId}
186
+ >
187
+ Error getting weather: {String(output.error)}
188
+ </div>
189
+ );
190
+ }
191
192
return (
193
<div className={widthClass} key={toolCallId}>
194
<Weather weatherAtLocation={part.output} />
0 commit comments