mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2025-12-20 01:11:25 +00:00
Proper error handling in mongo
This commit is contained in:
@@ -1392,7 +1392,6 @@ const DocumentsTabComponent: React.FunctionComponent<{
|
|||||||
|
|
||||||
onSaveNewDocumentClick = useCallback((): Promise<unknown> => {
|
onSaveNewDocumentClick = useCallback((): Promise<unknown> => {
|
||||||
const documentContent = JSON.parse(selectedDocumentContent);
|
const documentContent = JSON.parse(selectedDocumentContent);
|
||||||
// this.displayedError("");
|
|
||||||
const startKey: number = TelemetryProcessor.traceStart(Action.CreateDocument, {
|
const startKey: number = TelemetryProcessor.traceStart(Action.CreateDocument, {
|
||||||
dataExplorerArea: Constants.Areas.Tab,
|
dataExplorerArea: Constants.Areas.Tab,
|
||||||
tabTitle,
|
tabTitle,
|
||||||
@@ -1401,14 +1400,8 @@ const DocumentsTabComponent: React.FunctionComponent<{
|
|||||||
const partitionKeyProperty = partitionKeyProperties?.[0];
|
const partitionKeyProperty = partitionKeyProperties?.[0];
|
||||||
if (partitionKeyProperty !== "_id" && !_hasShardKeySpecified(documentContent)) {
|
if (partitionKeyProperty !== "_id" && !_hasShardKeySpecified(documentContent)) {
|
||||||
const message = `The document is lacking the shard property: ${partitionKeyProperty}`;
|
const message = `The document is lacking the shard property: ${partitionKeyProperty}`;
|
||||||
// TODO: Display error message here
|
useDialog.getState().showOkModalDialog("Create document failed", message);
|
||||||
|
onExecutionErrorChange(true);
|
||||||
// this.displayedError(message);
|
|
||||||
// const that = this;
|
|
||||||
// setTimeout(() => {
|
|
||||||
// that.displayedError("");
|
|
||||||
// }, Constants.ClientDefaults.errorNotificationTimeoutMs);
|
|
||||||
// this.isExecutionError(true);
|
|
||||||
TelemetryProcessor.traceFailure(
|
TelemetryProcessor.traceFailure(
|
||||||
Action.CreateDocument,
|
Action.CreateDocument,
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user