mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2025-12-25 11:51:07 +00:00
Refactor Data Access Utility (#112)
This commit is contained in:
@@ -7,7 +7,7 @@ import { AddDbUtilities } from "../Shared/AddDatabaseUtility";
|
||||
import { ConsoleDataType } from "../Explorer/Menus/NotificationConsole/NotificationConsoleComponent";
|
||||
import { CosmosClient } from "../Common/CosmosClient";
|
||||
import { HttpStatusCodes } from "../Common/Constants";
|
||||
import { MessageHandler } from "../Common/MessageHandler";
|
||||
import { sendMessage } from "../Common/MessageHandler";
|
||||
import { MessageTypes } from "../Contracts/ExplorerContracts";
|
||||
import { NotificationConsoleUtils } from "../Utils/NotificationConsoleUtils";
|
||||
import { ResourceProviderClient } from "../ResourceProvider/ResourceProviderClient";
|
||||
@@ -108,7 +108,7 @@ export class CreateSqlCollectionUtilities {
|
||||
`Error creating collection: ${JSON.stringify(response)}`
|
||||
);
|
||||
if (response.status === HttpStatusCodes.Forbidden) {
|
||||
MessageHandler.sendMessage({ type: MessageTypes.ForbiddenError });
|
||||
sendMessage({ type: MessageTypes.ForbiddenError });
|
||||
}
|
||||
throw new Error(`Error creating collection`);
|
||||
}
|
||||
@@ -202,7 +202,7 @@ export class CreateCollectionUtilities {
|
||||
`Error creating graph: ${JSON.stringify(response)}`
|
||||
);
|
||||
if (response.status === HttpStatusCodes.Forbidden) {
|
||||
MessageHandler.sendMessage({ type: MessageTypes.ForbiddenError });
|
||||
sendMessage({ type: MessageTypes.ForbiddenError });
|
||||
}
|
||||
throw new Error(`Error creating graph`);
|
||||
}
|
||||
@@ -248,7 +248,7 @@ export class Utilities {
|
||||
`Error creating table: ${JSON.stringify(reason)}, Payload: ${params}`
|
||||
);
|
||||
if (reason.status === HttpStatusCodes.Forbidden) {
|
||||
MessageHandler.sendMessage({ type: MessageTypes.ForbiddenError });
|
||||
sendMessage({ type: MessageTypes.ForbiddenError });
|
||||
return;
|
||||
}
|
||||
throw new Error(`Error creating table`);
|
||||
|
||||
Reference in New Issue
Block a user