Subject | Re: [firebird-php] ibase_query and exceptions |
---|---|
Author | Lester Caine |
Post date | 2008-08-12T12:22:15Z |
Yves Glodt wrote:
If there is a problem with the query, then the FUNCTION returns with an error
code. It does not 'throw an exception'. You would have to create an exception
from the error code to do this, but that is not how I would normally do it. I
just handle the error returned.
--
Lester Caine - G8HFL
-----------------------------
Contact - http://lsces.co.uk/lsces/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk//
Firebird - http://www.firebirdsql.org/index.php
> Hello,What exception would you expect to be returned?
>
> I seem to have problems using exceptions:
>
> try {
> $sth = call_user_func_array('ibase_query', array_merge(array($c(), $q), $p));
> } catch (Exception $e) {
> echo 'Exception: '.$e->getMessage();
> exit;
> }
>
> This code never reaches the "catch" block, even I use an invalid SQL in $q.
>
> Does anyone have experience in using exceptions with the ibase_* functions?
If there is a problem with the query, then the FUNCTION returns with an error
code. It does not 'throw an exception'. You would have to create an exception
from the error code to do this, but that is not how I would normally do it. I
just handle the error returned.
--
Lester Caine - G8HFL
-----------------------------
Contact - http://lsces.co.uk/lsces/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk//
Firebird - http://www.firebirdsql.org/index.php