]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Ignore PEAR errors with code DB_DATAOBJECT_ERROR_NODATA
authorCraig Andrews <candrews@integralblue.com>
Fri, 7 May 2010 03:40:07 +0000 (23:40 -0400)
committerCraig Andrews <candrews@integralblue.com>
Fri, 7 May 2010 03:40:07 +0000 (23:40 -0400)
lib/common.php

index 2bda88c9744bf4da98208b5b8db32a27f971c11f..72a1b70751baa44d763416cba5424eacb0b8913a 100644 (file)
@@ -132,6 +132,12 @@ require_once INSTALLDIR.'/lib/serverexception.php';
 //set PEAR error handling to use regular PHP exceptions
 function PEAR_ErrorToPEAR_Exception($err)
 {
+    //DB_DataObject throws error when an empty set would be returned
+    //That behavior is weird, and not how the rest of StatusNet works.
+    //So just ignore those errors.
+    if ($err->getCode() == DB_DATAOBJECT_ERROR_NODATA) {
+        return;
+    }
     if ($err->getCode()) {
         throw new PEAR_Exception($err->getMessage(), $err->getCode());
     }