How to make ODAC throw an exception
Posted: Fri 09 Jul 2010 11:42
Hi everyone.
I have a problem with ODAC exception handling.
I have a special error message dialog where I show a "user understandable" message and in a detail field I put the exception message. The dialog is displayed in the exception handler like this:
In my first try with ODAC my error dialog was never shown, but instead a very simple dialog with the exception message was shown.
I found out that I had to implement an error handler (TDAConnectionErrorEvent). I set the "Fail" parameter to false and thought that the exception is now raised properly. But in my dialog, all that was displayed was "Operation aborted" because an EAbortError is raised.
Is there any way to make ODAC just raise the exception? I want to catch the exception in my GUI and display the error dialog like in the example above. I also use the same technique to write exceptions to my log file.
Thanks in advance,
Eric
I have a problem with ODAC exception handling.
I have a special error message dialog where I show a "user understandable" message and in a detail field I put the exception message. The dialog is displayed in the exception handler like this:
Code: Select all
try
//Execute some SQL
except
on E: Exception do
showErrorDialog("Error Message for user", E.Message);
end;
I found out that I had to implement an error handler (TDAConnectionErrorEvent). I set the "Fail" parameter to false and thought that the exception is now raised properly. But in my dialog, all that was displayed was "Operation aborted" because an EAbortError is raised.
Is there any way to make ODAC just raise the exception? I want to catch the exception in my GUI and display the error dialog like in the example above. I also use the same technique to write exceptions to my log file.
Thanks in advance,
Eric