Subject RE: [IBO] exception handling and Connection.OnError
Author Jason Wharton
> Lets say i have the following code:
>
> StoredProcedure.SQL.Clear;
> StoredProcedure.StoredProcName := 'MY_SP';
> .....
> TheTransaction.StartTransaction;
> try
> StoredProcedure.ExecProc;
> TheTransaction.Commit;
> except
> on E: Exception do
> TheTransaction.Rollback;
> end;
>
> Is there a way to get to IB_Connection.OnError event handler in case
> of network failre, despite of this try..except block?

You can get the errcode from the exception itself right inside of your
exception handling code.

on E: IB_ISCError do
if Connection.WasConnLost( E.errcode )


OR, if using TDataset based components:

on E: IBOISCError do
if Connection.WasConnLost( E.errcode )


Please double-check my spelling.

Jason