DtaWin server exceptions

This forum is meant for questions and discussions about the X# language and tools
User avatar
robert
Posts: 4520
Joined: Fri Aug 21, 2015 10:57 am
Location: Netherlands

DtaWin server exceptions

Post 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
XSharp Development Team
The Netherlands
robert@xsharp.eu
User avatar
wriedmann
Posts: 3755
Joined: Mon Nov 02, 2015 5:07 pm
Location: Italy

DtaWin server exceptions

Post 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
Wolfgang Riedmann
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
Karl-Heinz
Posts: 774
Joined: Wed May 17, 2017 8:50 am
Location: Germany

DtaWin server exceptions

Post 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
Post Reply