slightly better error handling

This commit is contained in:
Kyle Corbitt
2023-06-27 10:48:09 -07:00
parent f6f93a1161
commit ab32995eb9
5 changed files with 79 additions and 27 deletions

View File

@@ -55,7 +55,20 @@ export default function OutputCell({
</CellShell>
);
if (!output.data) return <CellShell>No output</CellShell>;
if (!output.data)
return (
<CellShell>
<Text color="gray.500">Error retrieving output</Text>
</CellShell>
);
if (output.data.errorMessage) {
return (
<CellShell>
<Text color="red.600">Error: {output.data.errorMessage}</Text>
</CellShell>
);
}
return (
// @ts-expect-error TODO proper typing and error checks