Skip to content

Commit f65ee38

Browse files
authored
Concat uiSideErrors in Cell output (#11364)
* Concat uiSideErrors in Cell output * Better key
1 parent d79bb03 commit f65ee38

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

src/datascience-ui/interactive-common/cellOutput.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,9 @@ export class CellOutput extends React.Component<ICellOutputProps> {
200200
if (nextProps.cellVM.cell.data.outputs !== this.props.cellVM.cell.data.outputs) {
201201
return true;
202202
}
203+
if (nextProps.cellVM.uiSideError !== this.props.cellVM.uiSideError) {
204+
return true;
205+
}
203206
if (
204207
!this.isCodeCell() &&
205208
nextProps.cellVM.cell.id !== Identifiers.EditCellId &&
@@ -272,7 +275,7 @@ export class CellOutput extends React.Component<ICellOutputProps> {
272275
// tslint:disable: react-no-dangerous-html
273276
if (this.props.cellVM.uiSideError) {
274277
outputs.push(
275-
<div className="cell-output-uiSideError">
278+
<div key={'uiError'} className="cell-output-uiSideError">
276279
<div dangerouslySetInnerHTML={{ __html: this.props.cellVM.uiSideError }} />
277280
</div>
278281
);

src/datascience-ui/interactive-common/redux/reducers/commonEffects.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,9 +243,11 @@ export namespace CommonEffects {
243243
"Widgets require us to download supporting files from a 3rd party website. Click <a href='https://command:python.datascience.enableLoadingWidgetScriptsFromThirdPartySource'>here</a> to enable this or click <a href='https://aka.ms/PVSCIPyWidgets'>here</a> for more information. (Error loading {0}:{1})."
244244
).format(arg.payload.data.moduleName, arg.payload.data.moduleVersion);
245245
}
246+
// Preserve existing error messages.
247+
const existingErrorMessage = current.uiSideError ? `${current.uiSideError}\n` : '';
246248
newVMs[index] = Helpers.asCellViewModel({
247249
...current,
248-
uiSideError: errorMessage
250+
uiSideError: `${existingErrorMessage}${errorMessage}`
249251
});
250252

251253
// Make sure to tell the extension so it can log telemetry.

0 commit comments

Comments
 (0)