Horde::logMessage('Page ' . $pagename . ' saved with user agent ' . $GLOBALS['browser']->getAgentString(), 'DEBUG');
Horde::logMessage('Wicked_Driver_sql::updateText(): ' . $query, 'DEBUG');
- $this->_db->insert($query, $values);
-
- /* Return an error immediately if the query failed. */
- if (is_a($result, 'PEAR_Error')) {
- Horde::logMessage($result, 'ERR');
- return $result;
+ try {
+ $this->_db->insert($query, $values);
+ } catch (Horde_Db_Exception $e) {
+ Horde::logMessage($e->getMessage(), 'ERR');
+ throw new Wicked_Exception($e);
}
/* Now move on to updating the record. */
{
static $pageNames;
if (!isset($pageNames) || $no_cache) {
- $query = 'SELECT page_id, page_name FROM ' . $this->_params['table'];
-
+ $query = 'SELECT page_name FROM ' . $this->_params['table'];
Horde::logMessage('Wicked_Driver_sql::getPages(): ' . $query, 'DEBUG');
-
- $result = $this->_db->selectValues($query);
- if (is_a($result, 'PEAR_Error')) {
- return $result;
+ try {
+ $result = $this->_db->selectValues($query);
+ } catch (Horde_Db_Exception $e) {
+ throw new Wicked_Exception($e);
}
$pageNames = $this->_convertFromDriver($result);
}
-
if ($special) {
return $pageNames + $this->getSpecialPages();
}
--- /dev/null
+<?php
+/**
+ * Base exception class for Wicked.
+ *
+ * Copyright 2009-2010 The Horde Project (http://www.horde.org/)
+ *
+ * See the enclosed file COPYING for license information (GPL). If you
+ * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
+ *
+ * @author Michael J. Rubinsky <mrubinsk@horde.org>
+ * @package Wicked
+ */
+class Wicked_Exception extends Horde_Exception_Prior
+{
+}