Re: error handling in pecl extensions (was Re: intl/resourcebundle)

From: Date: Mon, 21 Dec 2009 21:10:22 +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-6936@lists.php.net to get a copy of this message
Hi!
As stas pointed out to me, intl does not use exceptions for error handling. As a matter of fact, there seems to be a completely separate "error handling" within intl.
Yes, unfortunately :/
It's not separate, it's additional. PHP doesn't have standard error handling facilities on the level the API needs (like retaining specific error codes and messages, per-object granularity, etc.). If someone takes on himself to work on such facility - all power to him, I'd gladly convert. But since such thing doesn't exist yet, I had to implement my own.
- Constructors should throw exceptions, because there is no other way of returning error information.
Actually, ctors can return null (it's a bit of a trick, but it works just fine). -- Stanislav Malyshev, Zend Software Architect stas@zend.com http://www.zend.com/ (408)253-8829 MSN: stas@zend.com

« previous php.pecl.dev (#6936) next »