Forum Discussion
HKosova
Alumni
14 years ago
Hi Ján,
Currently, cross-unit exception handling in JScript works out of the box only for global functions. Exceptions raised by instance functions and prototype functions, like in your example, aren't passed between units.
The workaround is to redefine the prototype functions that throw exceptions in the unit where these exceptions are handled. Like this, for example:
---------------------------------------------------------------
Unit TestC
---------------------------------------------------------------
//USEUNIT TestB
var str_classA_exThrower_Code = TestA.classA.prototype.exThrower.toString();
eval("TestA.classA.prototype.exThrower = " + str_classA_exThrower_Code);
function classC()
{
...
Please refer to Supported Scripting Languages - Specifics of Usage for more details on TestComplete's cross-unit JScript support.