This class doesn't need a logger, any errors are already logged by the Db
authorJan Schneider <jan@horde.org>
Fri, 28 Jan 2011 20:29:02 +0000 (21:29 +0100)
committerJan Schneider <jan@horde.org>
Fri, 28 Jan 2011 20:35:12 +0000 (21:35 +0100)
instance. Fixes also re-throwing exceptions.

framework/History/lib/Horde/History/Sql.php

index 8888b33..a135425 100644 (file)
@@ -42,10 +42,9 @@ class Horde_History_Sql extends Horde_History
      *
      * @throws Horde_History_Exception
      */
-    public function __construct(Horde_Db_Adapter $db, Horde_Log_Logger $logger)
+    public function __construct(Horde_Db_Adapter $db)
     {
         $this->_db = $db;
-        $this->_logger = $logger;
     }
 
     /**
@@ -120,10 +119,7 @@ class Horde_History_Sql extends Horde_History
                             ' history_extra = ? WHERE history_id = ?', $values
                         );
                     } catch (Horde_Db_Exception $e) {
-                        if ($this->_logger) {
-                            $this->_logger->err($e);
-                            throw new Horde_History_Exception($e);
-                        }
+                        throw new Horde_History_Exception($e);
                     }
 
                     $done = true;
@@ -155,10 +151,7 @@ class Horde_History_Sql extends Horde_History
                     ' VALUES (?, ?, ?, ?, ?, ?)', $values
                 );
             } catch (Horde_Db_Exception $e) {
-                if ($this->_logger) {
-                    $this->_logger->err($e);
-                    throw new Horde_History_Exception($e);
-                }
+                throw new Horde_History_Exception($e);
             }
         }
     }