[dev] [commits] Horde branch master updated. 591ab423f6d9766b5b30d1f94d735cde9589ab19

Michael M Slusarz slusarz at horde.org
Thu Nov 14 04:37:09 UTC 2013


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]



More information about the dev mailing list