Open Source Project: 4GL Exceptions

Posted by Alon Blich on 21-Sep-2007 13:32

Check it out.

http://www.oehive.org/project/4gl_exceptions

All Replies

Posted by Admin on 25-Sep-2007 09:15

I believe John Sadd used a similar approuch to write exception handling in 4GL in the Autoedge sources (proExceptionStart.i and proException.p).

Posted by Alon Blich on 25-Sep-2007 12:18

theres alot of things i don't agree on with john (like he cares). things seem to get really complicated really fast with john, adm and oeri for example. good thing some of the other talented guys get to take a shot at the docs, the arch made simple is amazing. nothing like the regular docs.

i dont have a copy of autoedge near by and the download seems to be taking forever now. if i remember the basic syntax goes something like this -

:

end. /* try */

if catch( ) then do:

end. /* catch */

take for example that theres no finalize clause and you'd need to do something like this -

:

end. /* try */

/* put things you'd normally put in the finalize clause here, like, free up resources.

because the catch clause will probably throw this or another exception higher up.

BUT the thing is that the code right here might also throw an exception and then following catch( ) would be bypassed or if you'd wrap it in another try clause the catch( ) will catch that try exceptions so nesting try clause is also a problem. */

if catch( ) then do:

end. /* catch */

in comparison heres how it would be done with the 4gl thrown excpetions projects. thats how its supposed to be, it's too simple.

:

:

:

.

the whole try/catch/finally clause is wrapped in a one big do: block and acts just like another type of block, you could nest sub try clauses without any problems, has the features, behaves in the same way and order as if it was the real thing.

but the most important diff is that it's simple, javascript like. alot of the time the reference code gets monsterously complicated and proException.p in my opinion isn't really an exception it has so many features its hard to handle.

Posted by kevin_saunders on 27-Sep-2007 05:13

The Try/Catch functionality will become a native part of the ABL when 10.1C is released, scheduled for Q1.

This thread is closed