in reply to Re: DBD::Sybase and dump dataabse
in thread DBD::Sybase and dump dataabse

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?

thor

Replies are listed 'Best First'.
Re: Re: Re: DBD::Sybase and dump dataabse
by mpeppler (Vicar) on May 16, 2004 at 05:43 UTC
    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