Hi Big Cat, unfortunately, it's not as straight forward as I had first thought as a bit of trial and error has revealed Exceptions thrown in a script Extension can't (surprise surprise) be caught externally
This means the wrapper Script Extension cannot throw Exceptions, instead, I have it returning Exception objects, then, to catch these I have the following in a common script unit:
function handle( result, handler, evaluator ) {
if( ( ( ! evaluator ) && ArcInnovations.ExceptionFactory.isException( result ) ) || evaluator( result ) ) {
if( handler ) {
return handler( result );
} else {
throw result;
}
}
return result;
}
which is then used similar to the following:
function test001() {
var result;
try {
result = Lang.handle( testObj.throwEx( true ) );
Log.Message( result );
} catch( exObj ) {
Log.Message( exObj.exceptionString() );
}
}
It's hacky and clunky but it works, and it's the best I've been able to come up with.
Saying that, I do get
and this
in the intellisense without having to use //USEUNIT etc
I was happily surprised that Test Complete Allowed <RuntimeObject Name="_"> in the Description.xml file and created a runtime object _
Phil