UNIDAC ERROR HANDLING

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
Niel
Posts: 4
Joined: Sun 24 Feb 2013 08:54

UNIDAC ERROR HANDLING

Post by Niel » Sat 15 Jun 2013 15:05

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!

Niel
Posts: 4
Joined: Sun 24 Feb 2013 08:54

Re: UNIDAC ERROR HANDLING

Post by Niel » Sat 15 Jun 2013 15:41

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

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Re: UNIDAC ERROR HANDLING

Post by AlexP » Thu 20 Jun 2013 08:39

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

Post Reply