How about adding something like this to the FDConnection event OnError?
I am hoping it fires on all exceptions that are generated via the connection.
procedure TForm2.FDConnection1Error(ASender, AInitiator: TObject; var
AException: Exception);
begin
if (AInitiator <> nil) then
if AInitiator is Tcomponent then
AException.Message:='Error: '+Tcomponent(AInitiator).Name+' threw a wobbly'+crlf+AException.message;
Jason Chapman
JAC2 Consultancy Limited
Mob: 07966211959
--
You received this message because you are subscribed to the Google Groups "firebird-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firebird-suppo...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/firebird-support/0864091e-8027-436b-8fae-e0d976e7fcfbn%40googlegroups.com.
First of all do not multipost– you have asked here as „better error messages”
And you got an answer from Mark Rotteveel.
I really do not understand your problem. You are the autor of the application?
If yes, simply add try except when you open some query.
e.g.:
fdquery1.SQL.Text:= ‘SELECT 1/0 FROM RDB$DATABASE’;
try
fdquery1.open;
except
on E: Exception do
begin
E.Message:= E.Message + sLineBreak + fdquery1.SQL.Text;
Raise;
end
end;
you got full sql query text in error message.
You can also create procedure like FDOpen(FDQuery: TFDQuery) with above code to use it in avery places.
Regards,
Karol Bieniaszewski
--
I have converted from ADS to firebird/firedac, how are you running the SQL script. TFDQuery?
Does the query run in a DB editor?
Might be a problem with Field mapping to a component.
Regards
Flavius Fernandes
Founder |Solution & Software Architect
ERPSirius UK
To view this discussion on the web, visit https://groups.google.com/d/msgid/firebird-support/f80123c2-e2ef-4ab7-a525-d8a454d567e9n%40googlegroups.com.
Hi,
I also note that if you create an application level inspection handler (Search for TApplication.OnException I think), you can then inspect the actual exception object raised.
If e is EFDDBEngineException then
EFDDBEngineException(e).FDObName…..
Looks like they have anticipated this and made it pretty easy to add code in one place.
Jason Chapman
JAC2 Consultancy Limited
Mob: 07966211959
ukDevGroup organiser – UK Based Delphi and a hundred other things all wrapped up in a friendly monthly meeting www.ukdevgroup.co.uk
To view this discussion on the web, visit https://groups.google.com/d/msgid/firebird-support/047e3e89-e0a5-4f83-85ad-10f10347e75cn%40googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/firebird-support/77252572-22af-4aea-b257-d9792c69f656n%40googlegroups.com.