schaapie
Member
I am trying to catch stop conditions (caused by a lock timeout) and errors in a program calling another program.
I have tried various options, but end up trapping either errors OR the stop:
Has anyone any clue how to do this?
Following code is some of the things I tried, but now I can't distingish between the type of errors occuring (.p not found, lock timeout, db-not connected, parameters incorrect etc.).
I have tried various options, but end up trapping either errors OR the stop:
Has anyone any clue how to do this?
Following code is some of the things I tried, but now I can't distingish between the type of errors occuring (.p not found, lock timeout, db-not connected, parameters incorrect etc.).
Code:
output to c:\temp\1.txt.
run runWithStopDetect('dwobj/TabelCategorie.p') no-error.
put unformatted 'error ' error-status:error skip
'num ' error-status:num-messages skip
'return ' return-value.
output close.
procedure runWithStopDetect:
define input parameter cScript as character no-undo.
do on error undo, leave
on stop undo, return "Stop event":
run value(cScript) no-error.
end.
put unformatted 'error'
error-status:error
error-status:num-messages skip.
end procedure.