Skip to content

A reactive notebook for Python — run reproducible experiments, query with SQL, execute as a script, deploy as an app, and version with git. Stored as pure Python. All in a modern, AI-native editor.

Filter out ancestor-stopped errors in cell output. (#332)

Myles Scolnickface01d4e042
diff --git a/frontend/src/core/cells/cells.ts b/frontend/src/core/cells/cells.ts
index cc0a71f4f9..4fc956ad3f 100644
--- a/frontend/src/core/cells/cells.ts
+++ b/frontend/src/core/cells/cells.ts
@@ -515,12 +515,23 @@ const cellErrorsAtom = atom((get) => {
const errors = cellIds
.map((cellId) => {
const cell = cellRuntime[cellId];
- return cell.output?.mimetype === "application/vnd.marimo+error"
- ? {
- output: cell.output,
+ if (cell.output?.mimetype === "application/vnd.marimo+error") {
+ // Filter out ancestor-stopped errors
+ // These are errors that are caused by a cell that was stopped,
+ // but nothing the user can take action on.
+ const nonAncestorErrors = cell.output.data.filter(
+ (error) => error.type !== "ancestor-stopped"
+ );
+
+ if (nonAncestorErrors.length > 0) {
+ return {
+ output: { ...cell.output, data: nonAncestorErrors },
cellId: cellId,
- }
- : null;
+ };
+ }
+ }
+
+ return null;
})
.filter(Boolean);
return errors;