Hello! I use LiteScript.
Now if error occured, then it trigger OnError event, but then show error message on screen.
I use it in windows service, and need disable showing error message.
How can I do it?
I need this in SDAC and ODAC too.
Thanks,
Dmitry Ukolov.
Disable showing error message for script
Re: Disable showing error message for script
Make it as:
Is it correct?
Code: Select all
for i := 0 to ScriptRunner.Statements.Count-1 do
begin
Statement := ScriptRunner.Statements[i];
try
Execute(Statement.SQL, EmptyParam);
except
on E : Exception do
FScriptErrors.Add(E.Message + #13#10 + 'SQL: '+Statement.SQL+#13#10);
end;
end;
Re: Disable showing error message for script
In order to avoid showing error messages, you should set the Action parameter in the LiteScript.OnError event handler to eaContinue if you want to continue script execution, or to eaAbort if you want to abort script execution. In both these cases, no error message will be displayed.
Please, refer to the help topic for the TErrorAction enumeration in the LiteDAC documentation to learn more about possible Action values.
Please, refer to the help topic for the TErrorAction enumeration in the LiteDAC documentation to learn more about possible Action values.