Re: PEAR::setErrorHandling conflicts with nextId() ?
| From: | (Stig Sæther Bakken) | Date: | Fri, 31 Aug 2001 12:51:09 +0000 |
| Subject: | Re: PEAR::setErrorHandling conflicts with nextId() ? | ||
| References: | 1 2 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-1734@lists.php.net to get a copy of this message | ||
["Tomas V.V.Cox" <cox@idecnet.com>]
> Stig Bakken wrote:
> >
> >
> > IMHO it's better to use expectError() than pushErrorHandling() for the
> > sequence code. I don't know if you agree Tomas?
> >
>
> Sure, but let me first finish to debug PEAR.php :-)
>
> Now there is a problem (reported by Piotr) in this case:
>
> $db->setErrorHandling(PEAR_ERROR_CALLBACK, 'some_func');
> $db->nextID('non', false);
>
> Outputs: "Invalid callback function" but do the work.
>
> I've done a patch to solve that, but involves to drop the
> "default_error_calback" var (that I never was very sure if it is really
> needed or not). For me, if you setup a error mode you could setup the
> error options for this mode. If a PEAR_ERROR_CALLBACK mode is selected,
> its error options should be the "default_error_options". Why is it
> different from the others modes and use "default_error_callback" instead
> of "default_error_options"?
>
> This is my patch: use default_error_options as the options for
> PEAR_ERROR_CALLBACK. Tests were right and also I did some grep's over
> php4/pear to ensure that no classes use "default_error_callback".
>
> Opinions?
The thought behind this (having separate variables for options and
callback) was to let you switch back and forth between for example
PEAR_ERROR_CALLBACK and PEAR_ERROR_RETURN without specifying the
callback again, but that doesn't really make much sense anymore?
Just commit the patch, we can test it a while and see if anything has
been overlooked.
- Stig
--
Stig Sæther Bakken <ssb@alltheweb.com>
Fast Search & Transfer ASA, Trondheim, Norway