xsharp.eu • DtaWin server exceptions - Page 2
Page 2 of 2

DtaWin server exceptions

Posted: Wed Aug 28, 2019 11:56 am
by robert
Wolfgang
What I'm interested in: how the code recover block in the begin/end sequence block is translated by the compiler.
We use a similar approach as Vulcan:

Code: Select all

BEGIN SEQUENCE ... RECOVER [USING varname]... END SEQUENCE
is translated to 2 try blocks

The outer block is a

Code: Select all

try .. catch

inside the catch we check to see if the exception ex was a 'WrappedException' which happens when you call BREAK in your code with a value.
If it is a normal Exception (from the framework) then we create a new WrappedException.
We then extract the value from this WrappedException and assign it to the variable in the RECOVER statement
the try block in this try catch contains the inner try statement

The inner try statement is a Try .. FInally where we call

Code: Select all

CompilerServices.EnterBeginSequence()
in the try and

Code: Select all

CompilerServices.ExitBeginSequence()
in the finally.
The rest of this try block is the original code inside the BEGIN SEQUENCE
These 2 helper methods are called so the runtime function _CanBreak() knows that we are in a BEGIN SEQUENCE.. END. Inside the compilerServices class we keep track of the "BreakLevel" for the current thread.

The BREAK <value> statement is translated to a call to

Code: Select all

throw WrappedException{<value>}
We have used similar names as in Vulcan. Why invent the wheel again ?

Robert

DtaWin server exceptions

Posted: Wed Aug 28, 2019 12:09 pm
by wriedmann
Hi Robert,

thank you very much for this clarification!

I will add that to the wiki, together with other informations, and then ask you if I have written it correctly.

Wolfgang

DtaWin server exceptions

Posted: Thu Aug 29, 2019 4:31 pm
by Karl-Heinz
Guys,

who takes care of the German.resx ?

i suggest to change the "ERROR_STACK" value from "Gerufen von" to "Aufrufreihenfolge". ?

Any better suggestion ?


regards
Karl-Heinz