Hi all!
I just ran this simple script for error handling tests and according to IBM the error window shouldn´t had popped, due to the fact
that the "onError --label subManipular_Erro" command is located at the begining of code and also - recover command - was
provided inside the error handling sub-routine, making sure that the error was treated and exempting the need for error window.
So, why this error window popped ? Please kindly check the code below for you analysis.
defVar --name varResultado
--type Numeric
defVar --name varData_Hora_Atuais
--type DateTime
onError --label subManipular_Erro
evaluate --expression "10/0" varResultado=value
logMessage --message "
${varResultado}"
--type "Info"
beginSub --name subManipular_Erro
getCurrentDateAndTime --localorutc "LocalTime" varData_Hora_Atuais=value
logMessage --message "------------------------------------------------------------\r\nData e hora do erro:
${varData_Hora_Atuais}\r\nMensagem do erro: ${wdg:error.Message}\r\nLinha do erro: ${wdg:error.LineNumber}\r\nComando: ${wdg:error.Command}\r\nScript do erro: ${wdg:error.Script}\r\nRotina do erro: ${wdg:error.Routine}"
--type "Info"
recoverendSub
Cordial Regards,
------------------------------
Mauro Sérgio
------------------------------