Hi there,

Is there is a way to force a customised Java exception from object script
when the java client has invoked a class method that does not explicitly
return a %Status code. i.e. a method is called that returns some object if
successful but returns an error status code if unsuccessful and hence
triggers a customised Java exception.

So far I have only been able to display the error code from the originally
invoked object script method using the line:
Do
$system.OBJ.DisplayError(##class(trg.ImplClass).ReturnError($$$InvalidID))

ReturnError simply accepts a user defined status code and returns this
status value as follows:
ClassMethod ReturnError(error As %Status) As %Status
{
 quit $$$ERROR(error)
}

Control is reverted to the called code and the method above does not get the
chance to trigger the CacheException in the java client as desired.

As a test I wrote another client that invokes a class method using java
projections that returns a status explicitly and this works fine - i.e.
throws a CacheException on the 'quit'. Is there a way to make this work
without calling such a method directly?

Any help is appreciated.

Thanks and Regards,
Michelle.



Reply via email to