Page 1 of 1

UNIDAC ERROR HANDLING

Posted: Sat 15 Jun 2013 15:05
by Niel
Dear DEVART support,

Can you please provide example on how to catch unidac errors like in my example below? It seems that my code below is not correctly catching the error when I put a wrong db password. Delphi XE4 still prompts the error message dialog screen when it hits the error.

try
UniConnection1.ProviderName := 'SQLite';
// the name of the database to be encrypted
UniConnection1.Database := FileName;
UniConnection1.SpecificOptions.Values['Direct'] := 'True';
UniConnection1.SpecificOptions.Values['EncryptionAlgorithm'] := 'leAES256';
UniConnection1.SpecificOptions.Values['EncryptionKey'] := Password;
UniConnection1.Open; // connect to the database
except
on EUniError do
ErrorRoutine;
end;

Thank you very much for your support!

Re: UNIDAC ERROR HANDLING

Posted: Sat 15 Jun 2013 15:41
by Niel
Here is an update. The error prompt only happens during debug mode. I don't know if this is a bug or just a default behavior of Delphi XE4. The exception handling is working ok when I am not in debug mode. :D

Re: UNIDAC ERROR HANDLING

Posted: Thu 20 Jun 2013 08:39
by AlexP
Hello,

This is correct behaviour for all the Delphi versions. In order for errors not to be displayed when running in the debug mode from the IDE, you should disable the "Notify on language exceptions" option in the IDE options: Tools->Options->Debugger Options->Embarcadero Debuggers->Languge Exceptions