From 8268766c6436acdf30e1314ba39dc7a9a1efaa8f Mon Sep 17 00:00:00 2001 From: Abhinav Rau Date: Thu, 22 Aug 2024 15:03:52 -0500 Subject: [PATCH] Fix bug with error handling and await for context.sync() --- src/search_runner.js | 2 +- src/synthetic_qa_runner.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/search_runner.js b/src/search_runner.js index 97100ec..5199c39 100644 --- a/src/search_runner.js +++ b/src/search_runner.js @@ -27,7 +27,7 @@ export async function getSearchConfig() { const worksheetName = currentWorksheet.name; const configTable = currentWorksheet.tables.getItem(`${worksheetName}.ConfigTable`); const valueColumn = getColumn(configTable, "Value"); - await context.sync(); + config = { vertexAISearchProjectNumber: valueColumn.values[1][0], diff --git a/src/synthetic_qa_runner.js b/src/synthetic_qa_runner.js index b42feb4..89e0b04 100644 --- a/src/synthetic_qa_runner.js +++ b/src/synthetic_qa_runner.js @@ -27,7 +27,7 @@ export async function getSyntheticQAConfig() { const worksheetName = currentWorksheet.name; const configTable = currentWorksheet.tables.getItem(`${worksheetName}.ConfigTable`); const valueColumn = getColumn(configTable, "Value"); - await context.sync(); + config = { vertexAIProjectID: valueColumn.values[1][0], @@ -220,7 +220,7 @@ async function processResponse(rowNum, output, generatedQuestionColumn, expected cell_status.format.fill.color = '#FFCCCB'; cell_status.values = [["Failed. Error: " + err.message]]; } finally { - context.sync(); + await context.sync(); }