Move UDF and trigger operations to RP (#283)

Move UDF and trigger operations to RP
This commit is contained in:
victor-meng
2020-10-16 12:58:45 -07:00
committed by GitHub
parent b9245101bc
commit 9a5d46b6e0
11 changed files with 314 additions and 61 deletions

View File

@@ -5,11 +5,11 @@ import {
SqlStoredProcedureResource
} from "../../Utils/arm/generatedClients/2020-04-01/types";
import { client } from "../CosmosClient";
import { logConsoleError, logConsoleProgress } from "../../Utils/NotificationConsoleUtils";
import {
createUpdateSqlStoredProcedure,
getSqlStoredProcedure
} from "../../Utils/arm/generatedClients/2020-04-01/sqlResources";
import { logConsoleError, logConsoleProgress } from "../../Utils/NotificationConsoleUtils";
import { logError } from "../Logger";
import { sendNotificationForError } from "./sendNotificationForError";
import { userContext } from "../../UserContext";
@@ -60,8 +60,9 @@ export async function updateStoredProcedure(
.replace(storedProcedure);
return response?.resource;
} catch (error) {
logConsoleError(`Error while updating stored procedure ${storedProcedure.id}:\n ${JSON.stringify(error)}`);
logError(JSON.stringify(error), "UpdateStoredProcedure", error.code);
const errorMessage = error.code === "NotFound" ? `${storedProcedure.id} does not exist.` : JSON.stringify(error);
logConsoleError(`Error while updating stored procedure ${storedProcedure.id}:\n ${errorMessage}`);
logError(errorMessage, "UpdateStoredProcedure", error.code);
sendNotificationForError(error);
throw error;
} finally {