Forum Discussion

ivan_weng's avatar
ivan_weng
Occasional Visitor
5 years ago
Solved

Can't catch exceptions

error message is "The text was rejected."   The control reported that the text is invalid due to the following reason: "Reserved word can not be used". Tested object: Aliases.DIADesigner.HwndSo...
  • AlexKaras's avatar
    5 years ago

    Hi,

     

    try/catch are the means of the programming language to handle runtime errors like division by zero, memory access at 0x0 and the like. Also, these runtime errors may be simulated with the help of the throw.

     

    Your code does not fail because of runtime problem: control exists, text can be entered into control and control can be clicked. Thus, no reason to throw an exception from the operating system point of view.

     

    What you need to do to handle your case is to check whether or not the error message exists and proceed appropriately.