Subject Re: [IBO] Trouble in catching Post error
Author Helen Borrie (TeamIBO)
At 01:52 PM 20-02-02 +0200, you wrote:
>Hi!
>
>IBO 4.2 Fp, BCB5
>
>I added OnPostError event to my query to rollback some changes I do in BeforePost event (they are done in another database).
>When I insert new record and it has some needed fields missing, I get corresponding errormessage for IBO, but my OnPostError is not reached. I tried to include all other kind of On...Error events, but they were not called also?

Were they "not called" or were they handled elsewhere because your code didn't catch the exact exception that occurred? What does your handler do with the EIB_Error that is passed to the event? Did you declare your own EIB_Error classes to handle the specific exceptions that might have occurred?

btw, you don't need those specific On..Error handlers - they are there for VCL compatibility - you can do much more centralised error handling at the connection level in IBO. There's good argument for not dispersing error handlers all over the place. They are more easily maintained and, if you organise them neatly, you can make it easy for yourself and your peer reviewers to test your error-handling "stack" (what happens next, if an exception is passed up to the next level in the exception hierarchy?) It makes the opportunities to make generic handlers much more obvious, too...


regards,
Helen Borrie (TeamIBO Support)

** Please don't email your support questions privately **
Ask on the list and everyone benefits
Don't forget the IB Objects online FAQ - link from any page at www.ibobjects.com