Re: ext/intl

From: Date: Sun, 10 May 2009 18:53:42 +0000
Subject: Re: ext/intl
References: 1 2 3  Groups: php.qa 
Request: Send a blank email to php-qa+get-64934@lists.php.net to get a copy of this message
On 10.05.2009, at 20:48, Stanislav Malyshev wrote:
Hi!
And even more annoying is the fact ext/intl invents its own error reporting completely. It silently fails and error message retrieval is left as exercise for the user, exactly the opposite of what _all_ other extensions do.
Isn't that what is described here? http://us.php.net/mysql_error Errors coming back from the MySQL database backend no longer issue warnings. Instead, use mysql_error() to retrieve the error text. Note that this function only returns the error text from the most recently executed MySQL function (not including mysql_error() and mysql_errno()), so if you want to use it, make sure you check the value before calling another MySQL function. If you think it should also produce warnings on each such instance, though as you'd need to handle the errors separately anyway, I'm not sure how useful that'd be. But it can be done.
Furthermore many of these messages are wrong, as they hardcode the function name to the message (see php_intl_idn_to() f.e.), rather then using the normal way of populating error messages.
They report where the error happened, what harm is in that?
Well generally our error reporting isnt beautiful. There are several places where one really needs to work with track errors to be able to properly handle the different error cases. I am sure one can find examples of pretty much every approach possible in core :( So when looking for what example to follow, I think we should try to keep similar things aligned. What people pointed out is that the two are related but act differently. Furthermore in terms of error reporting I would feel that this extension is closer to date/time, than databases. But obviously this is not an exact science and I also must admit that I havent put deep thought into this .. I am sure you did though. Somehow this extension continuously comes up with having people confused. So it seems to me like there is some real basis for the confusion or the issues reported are not fixed as expected or something is going on. regards, Lukas Kahwe Smith mls@pooteeweet.org

« previous php.qa (#64934) next »