[dev] [commits] Horde branch master updated. 591ab423f6d9766b5b30d1f94d735cde9589ab19
Jan Schneider
jan at horde.org
Thu Nov 14 10:23:32 UTC 2013
Zitat von Michael M Slusarz <slusarz at horde.org>:
> Quoting "Michael J. Rubinsky" <mrubinsk at horde.org>:
>
>> commit 591ab423f6d9766b5b30d1f94d735cde9589ab19
>> Author: Michael J Rubinsky <mrubinsk at horde.org>
>> Date: Wed Nov 13 19:57:26 2013 -0500
>>
>> Add Horde_Mongo_Exception
>>
>> framework/Mongo/lib/Horde/Mongo/Client.php | 8 +++++++-
>> framework/Mongo/lib/Horde/Mongo/Exception.php | 12 ++++++++++++
>> framework/Mongo/package.xml | 18 ++++++++++--------
>> 3 files changed, 29 insertions(+), 9 deletions(-)
>> create mode 100644 framework/Mongo/lib/Horde/Mongo/Exception.php
>>
>> http://github.com/horde/horde/commit/591ab423f6d9766b5b30d1f94d735cde9589ab19
>> http://git.horde.org/horde-git/-/commit/591ab423f6d9766b5b30d1f94d735cde9589ab19
>
> This is BC breaking.
>
> MongoClient::__construct() must throw a MongoConnectionException, as
> this is both 1) what is documented with
> Horde_Mongo_Client#__construct() as of 1.0.0:
>
> line 41:
> * @see MongoClient#__construct
>
> and 2) because this is extending the MongoClient object. You have
> to throw MongoConnectionException for that kind of error, because
> that is what is expected. It's OK to throw Horde_Mongo_Exception if
> it is some different kind of error, but that's not what you are
> doing here - you are taking the MongoConnectionException and
> repackaging in the wrong kind of Exception.
>
> http://us2.php.net/manual/en/mongoclient.construct.php
>
> michael
>
> ___________________________________
> Michael Slusarz [slusarz at horde.org]
Horde libraries should only throw Horde_Exceptions (or SPL exceptions
for developer errors), so this is semantically correct. It's still a
BC break though, so it has to wait for version 2.0.0 of Horde_Mongo.
--
Jan Schneider
The Horde Project
http://www.horde.org/
More information about the dev
mailing list