Sometimes I amaze myself with my own myopia. In actuality, I had set a syb_err_handler...that always returned 0. However, I have a question related to that. What I'm trying to do is create a record of what all is happening For example, when you normally dump a database, you receive messages like "DUMP phase 1 complete". I want to retain these messages, but continue to fail where I should.
My question is: if you don't explicitly return from the custom handler, is the error handled "properly" by DBI in all cases? That is to say: with respect to RaiseError, is any functionality changed by installing a custom handler?
| [reply] |
The normal way of handling this would be to check the second argument to the error handler (the error "severity"). If the severity is > 10 it is an error, and you should return a positive value from the handler so that DBI's normal error handling can catch the error. If the severity is <= 10 you do what you want with the message, and return 0 from the handler so that there is no risk that DBI will catch the error/message.
Michael
| [reply] |