Skip to content

Commit

Permalink
feat(notebooks): add error boundary around components (#24095)
Browse files Browse the repository at this point in the history
  • Loading branch information
thmsobrmlr authored Jul 31, 2024
1 parent 9a0e10f commit 5e9739c
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions frontend/src/scenes/notebooks/Nodes/NodeWrapper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -259,11 +259,13 @@ function NodeWrapper<T extends CustomNotebookNodeAttributes>(props: NodeWrapperP

{Settings && editingNodeId === nodeId && containerSize === 'small' ? (
<div className="NotebookNode__settings">
<Settings
key={nodeId}
attributes={attributes}
updateAttributes={updateAttributes}
/>
<ErrorBoundary>
<Settings
key={nodeId}
attributes={attributes}
updateAttributes={updateAttributes}
/>
</ErrorBoundary>
</div>
) : null}

Expand All @@ -278,7 +280,12 @@ function NodeWrapper<T extends CustomNotebookNodeAttributes>(props: NodeWrapperP
onClick={!expanded && expandOnClick ? () => setExpanded(true) : undefined}
onMouseDown={onResizeStart}
>
<Component attributes={attributes} updateAttributes={updateAttributes} />
<ErrorBoundary>
<Component
attributes={attributes}
updateAttributes={updateAttributes}
/>
</ErrorBoundary>
</div>
</>
)}
Expand Down

0 comments on commit 5e9739c

Please sign in to comment.