From 6010881530c950c9526da7f53bc3c6aa71adacbd Mon Sep 17 00:00:00 2001 From: Laurent Nguyen Date: Fri, 3 May 2024 14:43:28 +0200 Subject: [PATCH] Proper error handling in mongo --- src/Explorer/Tabs/DocumentsTabV2/DocumentsTabV2.tsx | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/src/Explorer/Tabs/DocumentsTabV2/DocumentsTabV2.tsx b/src/Explorer/Tabs/DocumentsTabV2/DocumentsTabV2.tsx index 2b93ace43..35f460d1a 100644 --- a/src/Explorer/Tabs/DocumentsTabV2/DocumentsTabV2.tsx +++ b/src/Explorer/Tabs/DocumentsTabV2/DocumentsTabV2.tsx @@ -1392,7 +1392,6 @@ const DocumentsTabComponent: React.FunctionComponent<{ onSaveNewDocumentClick = useCallback((): Promise => { const documentContent = JSON.parse(selectedDocumentContent); - // this.displayedError(""); const startKey: number = TelemetryProcessor.traceStart(Action.CreateDocument, { dataExplorerArea: Constants.Areas.Tab, tabTitle, @@ -1401,14 +1400,8 @@ const DocumentsTabComponent: React.FunctionComponent<{ const partitionKeyProperty = partitionKeyProperties?.[0]; if (partitionKeyProperty !== "_id" && !_hasShardKeySpecified(documentContent)) { const message = `The document is lacking the shard property: ${partitionKeyProperty}`; - // TODO: Display error message here - - // this.displayedError(message); - // const that = this; - // setTimeout(() => { - // that.displayedError(""); - // }, Constants.ClientDefaults.errorNotificationTimeoutMs); - // this.isExecutionError(true); + useDialog.getState().showOkModalDialog("Create document failed", message); + onExecutionErrorChange(true); TelemetryProcessor.traceFailure( Action.CreateDocument, {