S
Stefan Drissen
Guest
When a run-time error occurs the debugger can be launched when session:debug-alert is true or the session is started with -debugalert. When using traditional error handling, the debugger is positioned at the next statement, which generally means at the end of the block. This is annoying, the end of the block can be a long way away from the line with error. When using structured error handling, the debugger is positioned at the next statement, which is in the catch block. This has a major flaw. When routine-level on error undo, throw is used, the catch block can be outside the internal procedure throwing the error - all variables, buffers, etc that were in scope when the error occurred are now no longer in scope. Example: ROUTINE-LEVEL ON ERROR UNDO, THROW. RUN InternalProcedure. PROCEDURE InternalProcedure PRIVATE: DEFINE VARIABLE ii AS INT NO-UNDO. ii = RANDOM( 1, 10 ). INTEGER( "abc" ). END PROCEDURE. CATCH e AS PROGRESS.Lang.ERROR: MESSAGE 'what was ii?' SKIP e:GetMessage(1) VIEW-AS ALERT-BOX. END CATCH.
Continue reading...
Continue reading...