Subject Re: [firebird-php] How to capture exceptions?
Author Jochem Maas
Thomas Beckmann wrote:
>>why an exception? ... btw are we talking php exception or firebird
>>exception?
>
> About a firebird exception. Our application handles a lot of things right
> in the database, some of the calculating procedures reject some sets or
> combinations of parameters by raising an exception. This is handled by the
> Delphi front end nicely, but our new php-approach fails on that.

ok cool.

>
>
>>you may be using an older version of the extension... what
>>version of php are you running this on (php4 perhaps)?
>
> Yes, it's php 4.3.0.

ok - php 4.3.0 is 'old' - the latest release version of php4
is (atleast?) 4.3.11, you should upgrade regardless due to lots of
security fixes.... and maybe your problem will then fix itself.

otherwise try running you app on php5, which I would recommend anyway for
increase future-proofness.

>
>
>>ibase_query returns boolean false if I try this, which is what I would
>>expect
>
> It does not in php 4.3...
>
>>no need for the extension to trigger a php-level error...
>>although ibase_errmsg() and ibase_errcode() both return boolean false also
>
> Well, thus... is there any way to figure out what's wrong - I mean: there
> *is* a well defined error in Firebird on that statement...
>
>
>>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 :-)
>
> Of course, I do not want to divide by zero - but it is the most simple
> statement to raise a Firebird exception :-)

got it!

the thing is does firebird actually raise an exception in such as case? (I don't
know) or do exceptions only occur as a result of calling EXCEPTION inside (for instance)
a stored procedure.

>
> Any further ideas?