Subject | Identifying exceptions from Delphi |
---|---|
Author | dr_bentonquest |
Post date | 2004-07-09T20:29:47Z |
Hi there,
I use try/except blocks to trap FireBird database exceptions, for
instance:
Query1.Append;
try
Query1.Post;
except
on EDatabaseError do
begin
showmessage('Something went wrong');
end;
end;
However I want to know if the Insert failed because of a PK violation
or a FK violation or whatever, so I can send a clearer message to the
user.
How can I identify the right exception?
Thanks in advance,
-Jorge
Using D7
I use try/except blocks to trap FireBird database exceptions, for
instance:
Query1.Append;
try
Query1.Post;
except
on EDatabaseError do
begin
showmessage('Something went wrong');
end;
end;
However I want to know if the Insert failed because of a PK violation
or a FK violation or whatever, so I can send a clearer message to the
user.
How can I identify the right exception?
Thanks in advance,
-Jorge
Using D7