Page 1 of 1
TORAQuery exceptions
Posted: Tue 19 Jul 2016 07:14
by ErezHarari
I catch EOraError exceptions (mostly raised by TORAQuery) in
TOraSession.OnError or TApplicationEvents.OnException events
Can i figure out the component that raised the exception?
Remark: The EOraError(E).Component is TOraDataSet but it point to internal data set and i look for the original data set.
Re: TORAQuery exceptions
Posted: Thu 21 Jul 2016 10:19
by AlexP
Hello,
The EOraError(e).Component property points to the object, in which the error has occurred on the OnError event:
Code: Select all
procedure TForm1.OraSession1Error(Sender: TObject; E: EDAError;
var Fail: Boolean);
begin
ShowMessage(EOraError(e).Component.ClassName); //TOraQuery
ShowMessage(TOraQuery(EOraError(e).Component).Name); //OraQuery1
end;
Re: TORAQuery exceptions
Posted: Sun 24 Jul 2016 05:53
by ErezHarari
Thanks for your reply but in OnEditError handler, exceptions raised by TOraTable.Edit method
has the following attributes
EOraError(e).ErrorCode = 54
EOraError(e).Component.ClassName = 'TOraDataSet'
TOraDataSet(EOraError(e).Component).Name = ''
Note that EOraError(e).Component exists but it is TOraDataSet instead of TOraTable.
Re: TORAQuery exceptions
Posted: Wed 14 Sep 2016 09:15
by AlexP
Currently, this code will work correctly on errors in a SQL query. We will consider the possibility to add retrieving of "a real" component on errors at editing.