Subject Re: [firebird-php] How to capture exceptions?
Author Jochem Maas
mupedv wrote:
> I would expect an "ibase_query('select 1/0 from rdb$database;');" to

technically you should not be adding the semi-colon at the end of the query
here - ibase_query only excepts 1 query and adds the semi-colon internally -
in practice the underlying code is smart enough to see you have already added it,
so no problem as such :-)

> raise an exception.

why an exception? ... btw are we talking php exception or firebird exception?

> Actually, this returns a well-defined result pointing to an empty
> result set. ibase_errmsg is empty.

you may be using an older version of the extension... what
version of php are you running this on (php4 perhaps)?

[the ibase/firebird extension has been extensively improved for PHP5 - not all
the goodness may be available in pre-5 versions]

ibase_query returns boolean false if I try this, which is what I would expect
(no need for the extension to trigger a php-level error... I can determine how to
handle the 'problem' myself thanks :-)), although ibase_errmsg() and ibase_errcode()
both return boolean false also which is a little unexpected in this case.

> How can I catch this kind of exceptions? (User defined exceptions are

why do you need to perform this particular query?... a little more insight
into what you are trying to do would help us to help you :-)

> ignored as well, actually, I tried to capture these by an
> error_handler but had no success and finally ended up with the above
> example...).
>
> Any hints are welcome!
>
>
>
>
>
>
>
> Yahoo! Groups Links
>
>
>
>
>
>