Unknown [object Error]: -2147417825
Sometime try-catch block returns an unknown 'object error' which has no description, but only number -2147417825. It can happen about 1 time in 20-50 cycles if start test in cycle. Is it possible to find out what happening?
function WaitForRep (){
try{
var watch = HISUtils.StopWatch
watch.Start()
Vantage = Sys.WaitProcess("***.Monitor", 1000)
if (!Vantage.WaitWinFormsObject("MonitorForm", 10000).Exists)
throw new Error(1, "Grid is unavailable")
var isComplete = false
var isCompleteCount
var ultraGrid1 = Sys["Process"]("***.Monitor")["WinFormsObject"]("MonitorForm")["WinFormsObject"]("monitorPanel1")["WinFormsObject"]("ultraTabControl1")["WinFormsObject"]("ultraTabPageControl1")["WinFormsObject"]("tasksPanel1")["WinFormsObject"]("frDataGrid1")
var rows1 = ultraGrid1["Rows"]
var cell_1
var cells1
while (!isComplete){
BuiltIn.Delay(10000)
ClickToolButton("Refresh")
isCompleteCount = 0
for (var i = 0; i<rows1.Count ;i++){
cells1 = rows1["Item"](i).Cells
for (var j=0; j<cells1.Count;j++){
cell_1 = cells1.Item(j)
if (cell_1["Column"]["Key"] == "LastAction_" && cell_1["Text"]=="DS: No replicated transactions are available."){isCompleteCount = isCompleteCount + 1}
} }
if (isCompleteCount == rows1.Count){isComplete = true}
if (watch.Split() > 600000){
Log["Warning"]("waiting time is out")
return false}}
return true}
catch(e){
Log.Error(e+e.description)
return false
}}
function ClickToolButton(menuItemName, pathToFrame){
try{
var menuItemName = Utilities.Trim(Localize(menuItemName))
pathToFrame = pathToFrame || Sys.Desktop.ActiveWindow()
var ultraToolBar = pathToFrame.WinFormsObject("_FormBase_Toolbars_Dock_Area_Top")
for (var i = 0; i < ultraToolBar.wItems.Count; i++){
var menuItems = ultraToolBar["wItems"].Item(i).Items
for(var j = 0; j < menuItems.Count; j++){
if (Utilities.Trim(menuItems.Item(j).Text.replace(/&/g, "")) == menuItemName.replace(/&/g, "")){
menuItems.Item(j).Click()
return true}}}
throw new Error(2, "Menu item not found - '" + menuItemName + "'")
}
catch(e){
log.Error(e)
return false} }