Re: error handling in pecl extensions (was Re:intl/resourcebundle)
| From: | Hans-Peter Oeri | Date: | Sun, 20 Dec 2009 16:06:14 +0000 |
| Subject: | Re: error handling in pecl extensions (was Re:intl/resourcebundle) | ||
| References: | 1 2 3 | Groups: | php.pecl.dev |
| Request: | Send a blank email to pecl-dev+get-6933@lists.php.net to get a copy of this message | ||
Hi!
Derick Rethans wrote:
> - Nothing internally in PHP throws exceptions by default
Hmm... SPL does. The majority of PHP cannot use exceptions as they are
too recent, I agree. Newer additions, though, could.
> - Constructors should throw exceptions, because there is no other way of
> returning error information.
Please bear with me, but are you saying exceptions are solely "last
resort" if nothing else is available? That would factually eliminate
exceptions from the whole engine, reducing it to a php language construct?
> We've discussed this before I think—the general idea is that we
> definitely do *not* want INI settings that change this sort of behavior
> as they remove control over error reporting/handling from the
> developers.
I acknowledge I'm plainly pro exceptions - and I regularly override
PDO's default behaviour. Now, if more and more extension offer such an
option, wouldn't it be easier to have a "common" option to define a default?
Just as error_reporting, display_errors, track_errors, such a default
could go into the server setup/ini. I don't suggest it to be an admin
value and each extension or even object could override it for itself.
Regards
HPO