On Sat, Aug 13, 2022 at 8:45 AM Rony G. Flatscher <rony.flatsc...@wu.ac.at>
wrote:

> E.g. rxapi.pdf "1.17.189. *NEW* ThrowException/0/1/2" states: "Throw a
> SYNTAX condition. The API call doesn't return and the current method,
> routine, or exit is exited immediately.".
>
> Testing ThrowException1() however will end the running Rexx program
> immediately not the current call, here the calling sequence:
>
>    - test.rex requires some testpkg.cls, creating an object o of a class
>    residing in testpkg.cls
>    - test.rex will send an unknown message with two arguemtns to o
>    causing the unknown method to call a routine in the native code
>    - the native code will cause a runtime exception to be thrown if one
>    of the two arguments has the value 1
>
> Using RaiseException1() will cause that exception to be raised and the
> control gets back to the unknown method and then back to test.rex.
>
> Using ThrowException1() however will cause ending Rexx altogether as if it
> causes not only the call to the native routine to be exited immediately,
> but also the unknown method from which the call started and info.rex where
> o's unknown method gets invoked from. Is that to be expected?
>
Are you using the correct context instance when calling ThrowExeption()?
That's the behavior I would expect if an instance other than the context
for the external call was used. This could also explain some of the
problems you've been seeing with your calls.



> If so, when would one want to use ThrowException[0|1|2|3] over
> RaiseException[0|1|2|3]?
>

I would want to use it if I don't want to worry about unwinding my call
chain to do a normal return.

Rick


> ---rony
>
> _______________________________________________
> Oorexx-devel mailing list
> Oorexx-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/oorexx-devel
>
_______________________________________________
Oorexx-devel mailing list
Oorexx-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/oorexx-devel

Reply via email to