From b852ce0f8affdeb57cc473ba287b65d16d382fc0 Mon Sep 17 00:00:00 2001 From: Michael M Slusarz Date: Sat, 24 Apr 2010 11:29:39 -0600 Subject: [PATCH] Use IMP_Exception in more locations --- imp/lib/Ajax/Application.php | 2 +- imp/lib/Api.php | 1 + imp/lib/Compose.php | 8 ++++++-- imp/lib/Filter.php | 2 +- imp/lib/IMP.php | 2 +- imp/lib/Imap.php | 4 ++-- imp/lib/Imap/Acl.php | 16 ++++++++-------- imp/lib/Imap/Tree.php | 4 ++-- imp/lib/Message.php | 18 +++++++++--------- imp/lib/Prefs/Ui.php | 21 ++++++++++++++++----- imp/lib/Quota/Command.php | 4 ++-- imp/lib/Quota/Hook.php | 6 +++--- imp/lib/Quota/Imap.php | 4 ++-- imp/lib/Quota/Maildir.php | 4 ++-- imp/lib/Quota/Mdaemon.php | 4 ++-- imp/lib/Quota/Mercury32.php | 3 ++- imp/lib/Quota/Sql.php | 12 ++++++------ imp/lib/Sentmail.php | 8 ++++---- imp/lib/Sentmail/Sql.php | 18 +++++++++++------- imp/pgp.php | 6 +++--- imp/smime.php | 4 ++-- 21 files changed, 86 insertions(+), 65 deletions(-) diff --git a/imp/lib/Ajax/Application.php b/imp/lib/Ajax/Application.php index b66280b91..fde643ed8 100644 --- a/imp/lib/Ajax/Application.php +++ b/imp/lib/Ajax/Application.php @@ -1596,7 +1596,7 @@ class IMP_Ajax_Application extends Horde_Ajax_Application_Base { try { $GLOBALS['imp_imap']->checkUidvalidity($this->_vars->view); - } catch (Horde_Exception $e) { + } catch (IMP_Exception $e) { if (!is_object($result)) { $result = new stdClass; } diff --git a/imp/lib/Api.php b/imp/lib/Api.php index 71b5a64dd..54e2d2ca6 100644 --- a/imp/lib/Api.php +++ b/imp/lib/Api.php @@ -189,6 +189,7 @@ class IMP_Api extends Horde_Registry_Api * A value of null returns all message types. * * @return array A list with the $limit most favourite recipients. + * @throws IMP_Exception */ public function favouriteRecipients($limit, $filter = array('new', 'forward', 'reply', 'redirect')) diff --git a/imp/lib/Compose.php b/imp/lib/Compose.php index a926d814a..33c075493 100644 --- a/imp/lib/Compose.php +++ b/imp/lib/Compose.php @@ -444,6 +444,7 @@ class IMP_Compose * sent-mail folder. * @throws Horde_Exception * @throws IMP_Compose_Exception + * @throws IMP_Exception */ public function buildAndSendMessage($body, $header, $charset, $html, $opts = array()) @@ -742,8 +743,11 @@ class IMP_Compose Horde::logMessage('The permission for the maximum number of recipients per time period has been enabled, but no backend for the sent-mail logging has been configured for IMP.', 'ERR'); throw new IMP_Compose_Exception(_("The system is not properly configured. A detailed error description has been logged for the administrator.")); } - $sentmail = IMP_Sentmail::factory(); - $recipients = $sentmail->numberOfRecipients($GLOBALS['conf']['sentmail']['params']['limit_period'], true); + try { + $recipients = $sentmail->numberOfRecipients($GLOBALS['conf']['sentmail']['params']['limit_period'], true); + } catch (IMP_Exception $e) { + $recipients = 0; + } foreach ($result as $address) { $recipients += isset($address['grounpname']) ? count($address['addresses']) : 1; } diff --git a/imp/lib/Filter.php b/imp/lib/Filter.php index 11fdaad44..f21fe7d79 100644 --- a/imp/lib/Filter.php +++ b/imp/lib/Filter.php @@ -99,7 +99,7 @@ class IMP_Filter * notification message? * * @return boolean True on success. - * @throws Horde_Exception + * @throws IMP_Exception */ protected function _processBWlist($indices, $descrip, $reg1, $reg2, $link) { diff --git a/imp/lib/IMP.php b/imp/lib/IMP.php index de10b3727..45cb3b86e 100644 --- a/imp/lib/IMP.php +++ b/imp/lib/IMP.php @@ -603,7 +603,7 @@ class IMP try { $quotaDriver = $GLOBALS['injector']->getInstance('IMP_Quota'); $quota = $quotaDriver->getQuota(); - } catch (Exception $e) { + } catch (IMP_Exception $e) { Horde::logMessage($e, 'ERR'); return false; } diff --git a/imp/lib/Imap.php b/imp/lib/Imap.php index eeb029f9f..7450acdcb 100644 --- a/imp/lib/Imap.php +++ b/imp/lib/Imap.php @@ -306,7 +306,7 @@ class IMP_Imap * @param string $mailbox The mailbox to check. Must be an IMAP mailbox. * * @return string The mailbox UIDVALIDITY. - * @throws Horde_Exception + * @throws IMP_Exception */ public function checkUidvalidity($mailbox) { @@ -327,7 +327,7 @@ class IMP_Imap } if ($this->_uidvalid[$mailbox]) { - throw new Horde_Exception(_("Mailbox structure on server has changed.")); + throw new IMP_Exception(_("Mailbox structure on server has changed.")); } return $_SESSION['imp']['cache']['uidvalid'][$mailbox]; diff --git a/imp/lib/Imap/Acl.php b/imp/lib/Imap/Acl.php index fe766db23..a8df2ee50 100644 --- a/imp/lib/Imap/Acl.php +++ b/imp/lib/Imap/Acl.php @@ -31,20 +31,20 @@ class IMP_Imap_Acl /** * Constructor. * - * @throws Horde_Exception + * @throws IMP_Exception */ public function __construct() { if ($_SESSION['imp']['protocol'] != 'imap') { - throw new Horde_Exception(_("ACL requires an IMAP server.")); + throw new IMP_Exception(_("ACL requires an IMAP server.")); } if (empty($_SESSION['imp']['imap']['acl'])) { - throw new Horde_Exception(_("ACLs not configured for this server.")); + throw new IMP_Exception(_("ACLs not configured for this server.")); } if (!$GLOBALS['imp_imap']->ob()->queryCapability('ACL')) { - throw new Horde_Exception(_("IMAP server does not support ACLs.")); + throw new IMP_Exception(_("IMAP server does not support ACLs.")); } $this->_protected = array($GLOBALS['imp_imap']->ob()->getParam('username')); @@ -121,14 +121,14 @@ class IMP_Imap_Acl * @param string $mbox The mailbox to get the ACL for. * * @return array See Horde_Imap_Client_Base::getACL(). - * @throws Horde_Exception + * @throws IMP_Exception */ public function getACL($mbox) { try { return $GLOBALS['imp_imap']->ob()->getACL($mbox); } catch (Horde_Imap_Client_Exception $e) { - throw new Horde_Exception(_("Could not retrieve ACL")); + throw new IMP_Exception(_("Could not retrieve ACL")); } } @@ -139,14 +139,14 @@ class IMP_Imap_Acl * @param string $user The user to grant rights to. * @param array $acl The rights to be granted. * - * @throws Horde_Exception + * @throws IMP_Exception */ public function editACL($mbox, $user, $acl) { try { $GLOBALS['imp_imap']->ob()->setACL($mbox, $user, array('remove' => empty($acl), 'rights' => implode('', $acl))); } catch (Horde_Imap_Client_Exception $e) { - throw new Horde_Exception(sprintf(_("Couldn't give user \"%s\" the following rights for the folder \"%s\": %s"), $user, $mbox, implode('', $acl))); + throw new IMP_Exception(sprintf(_("Couldn't give user \"%s\" the following rights for the folder \"%s\": %s"), $user, $mbox, implode('', $acl))); } } diff --git a/imp/lib/Imap/Tree.php b/imp/lib/Imap/Tree.php index ddd2b3dde..68fa5c905 100644 --- a/imp/lib/Imap/Tree.php +++ b/imp/lib/Imap/Tree.php @@ -2023,7 +2023,7 @@ class IMP_Imap_Tree * @param string $parent The new mailbox name (UTF7-IMAP). * * @return string The full path to the new mailbox. - * @throws Horde_Exception + * @throws IMP_Exception */ public function createMailboxName($parent, $new) { @@ -2038,7 +2038,7 @@ class IMP_Imap_Tree return $new; } } - throw new Horde_Exception(_("Cannot directly create mailbox in this folder.")); + throw new IMP_Exception(_("Cannot directly create mailbox in this folder.")); } $mbox = $ns_info['name']; diff --git a/imp/lib/Message.php b/imp/lib/Message.php index b951641d1..68c302eb6 100644 --- a/imp/lib/Message.php +++ b/imp/lib/Message.php @@ -108,7 +108,7 @@ class IMP_Message if (!$error) { try { $GLOBALS['imp_imap']->checkUidvalidity($mbox); - } catch (Horde_Exception $e) { + } catch (IMP_Exception $e) { $error = $e->getMessage(); } } @@ -194,7 +194,7 @@ class IMP_Message if (!$error) { try { $GLOBALS['imp_imap']->checkUidvalidity($mbox); - } catch (Horde_Exception $e) { + } catch (IMP_Exception $e) { $error = $e->getMessage(); } } @@ -443,25 +443,25 @@ class IMP_Message * @param string $partid The MIME ID of the part to strip. All parts are * stripped if null. * - * @throws Horde_Exception + * @throws IMP_Exception */ public function stripPart($indices, $partid = null) { /* Return error if no index was provided. */ if (!($msgList = IMP::parseIndicesList($indices))) { - throw new Horde_Exception(_("An error occured while attempting to strip the attachment.")); + throw new IMP_Exception(_("An error occured while attempting to strip the attachment.")); } /* If more than one index provided, return error. */ reset($msgList); list($mbox, $index) = each($msgList); if (each($msgList) || (count($index) > 1)) { - throw new Horde_Exception(_("An error occured while attempting to strip the attachment.")); + throw new IMP_Exception(_("An error occured while attempting to strip the attachment.")); } $index = implode('', $index); if ($GLOBALS['imp_imap']->isReadOnly($mbox)) { - throw new Horde_Exception(_("Cannot strip the MIME part as the mailbox is read-only")); + throw new IMP_Exception(_("Cannot strip the MIME part as the mailbox is read-only")); } $GLOBALS['imp_imap']->checkUidvalidity($mbox); @@ -520,7 +520,7 @@ class IMP_Message $uid = $GLOBALS['imp_imap']->ob()->append($mbox, array(array('data' => $message->toString(array('headers' => $res['headertext'][0], 'stream' => true)), 'flags' => $res['flags']))); } catch (Horde_Imap_Client_Exception $e) { - throw new Horde_Exception(_("An error occured while attempting to strip the attachment.")); + throw new IMP_Exception(_("An error occured while attempting to strip the attachment.")); } $this->delete($indices, array('nuke' => true, 'keeplog' => true)); @@ -565,7 +565,7 @@ class IMP_Message if (!$error) { try { $GLOBALS['imp_imap']->checkUidvalidity($mbox); - } catch (Horde_Exception $e) { + } catch (IMP_Exception $e) { $error = $e->getMessage(); } } @@ -665,7 +665,7 @@ class IMP_Message if (is_array($val)) { try { $GLOBALS['imp_imap']->checkUidvalidity($key); - } catch (Horde_Exception $e) { + } catch (IMP_Exception $e) { continue; } } diff --git a/imp/lib/Prefs/Ui.php b/imp/lib/Prefs/Ui.php index 3c6c554b2..d06c1733f 100644 --- a/imp/lib/Prefs/Ui.php +++ b/imp/lib/Prefs/Ui.php @@ -269,7 +269,7 @@ class IMP_Prefs_Ui try { $GLOBALS['injector']->getInstance('IMP_Imap_Acl'); - } catch (Exception $e) { + } catch (IMP_Exception $e) { $ui->suppressGroups[] = 'acl'; } @@ -637,7 +637,12 @@ class IMP_Prefs_Ui ? 'INBOX' : $ui->vars->folder; - $curr_acl = $ACL->getACL($folder); + try { + $curr_acl = $ACL->getACL($folder); + } catch (IMP_Exception $e) { + $GLOBALS['notification']->notify($e); + return ''; + } $canEdit = $ACL->canEdit($folder, Horde_Auth::getAuth()); $t = $GLOBALS['injector']->createInstance('Horde_Template'); @@ -740,12 +745,18 @@ class IMP_Prefs_Ui } else { $GLOBALS['notification']->push(sprintf(_("All rights on folder \"%s\" successfully removed for user \"%s\"."), $ui->vars->folder, $new_user), 'horde.success'); } - } catch (Horde_Exception $e) { + } catch (IMP_Exception $e) { $GLOBALS['notification']->push($e); + return; } } - $curr_acl = $ACL->getACL($ui->vars->folder); + try { + $curr_acl = $ACL->getACL($ui->vars->folder); + } catch (IMP_Exception $e) { + $GLOBALS['notification']->notify($e); + return; + } $protected = $ACL->getProtected(); foreach ($acl_list as $user => $val) { @@ -786,7 +797,7 @@ class IMP_Prefs_Ui } else { $GLOBALS['notification']->push(sprintf(_("User \"%s\" successfully given the specified rights for the folder \"%s\"."), $user, $ui->vars->folder), 'horde.success'); } - } catch (Horde_Exception $e) { + } catch (IMP_Exception $e) { $GLOBALS['notification']->push($e); } } diff --git a/imp/lib/Quota/Command.php b/imp/lib/Quota/Command.php index 6cbeee887..599086c2a 100644 --- a/imp/lib/Quota/Command.php +++ b/imp/lib/Quota/Command.php @@ -69,7 +69,7 @@ class IMP_Quota_Command extends IMP_Quota * @return array An array with the following keys: * 'limit' = Maximum quota allowed * 'usage' = Currently used portion of quota (in bytes) - * @throws Horde_Exception + * @throws IMP_Exception */ public function getQuota() { @@ -88,7 +88,7 @@ class IMP_Quota_Command extends IMP_Quota 'limit' => $quota[2] * $blocksize); } - throw new Horde_Exception(_("Unable to retrieve quota")); + throw new IMP_Exception(_("Unable to retrieve quota")); } } diff --git a/imp/lib/Quota/Hook.php b/imp/lib/Quota/Hook.php index b84319627..15b902abd 100644 --- a/imp/lib/Quota/Hook.php +++ b/imp/lib/Quota/Hook.php @@ -25,19 +25,19 @@ class IMP_Quota_Hook extends IMP_Quota * @return array An array with the following keys: * 'limit' = Maximum quota allowed * 'usage' = Currently used portion of quota (in bytes) - * @throws Horde_Exception + * @throws IMP_Exception */ public function getQuota() { try { $quota = Horde::callHook('quota', array($this->_params), 'imp'); } catch (Horde_Exception_HookNotSet $e) { - throw new Horde_Exception($e->getMessage()); + throw new IMP_Exception($e->getMessage()); } if (count($quota) != 2) { Horde::logMessage('Incorrect number of return values from quota hook.', 'ERR'); - throw new Horde_Exception(_("Unable to retrieve quota")); + throw new IMP_Exception(_("Unable to retrieve quota")); } return array('usage' => $quota[0], 'limit' => $quota[1]); diff --git a/imp/lib/Quota/Imap.php b/imp/lib/Quota/Imap.php index e5f5c739d..a8860c426 100644 --- a/imp/lib/Quota/Imap.php +++ b/imp/lib/Quota/Imap.php @@ -21,14 +21,14 @@ class IMP_Quota_Imap extends IMP_Quota * @return array An array with the following keys: * 'limit' = Maximum quota allowed * 'usage' = Currently used portion of quota (in bytes) - * @throws Horde_Exception + * @throws IMP_Exception */ public function getQuota() { try { $quota = $GLOBALS['imp_imap']->ob()->getQuotaRoot($GLOBALS['imp_search']->isSearchMbox($GLOBALS['imp_mbox']['mailbox']) ? 'INBOX' : $GLOBALS['imp_mbox']['mailbox']); } catch (Horde_Imap_Client_Exception $e) { - throw new Horde_Exception(_("Unable to retrieve quota")); + throw new IMP_Exception(_("Unable to retrieve quota")); } if (empty($quota)) { diff --git a/imp/lib/Quota/Maildir.php b/imp/lib/Quota/Maildir.php index 990317df0..9235dcad1 100644 --- a/imp/lib/Quota/Maildir.php +++ b/imp/lib/Quota/Maildir.php @@ -42,7 +42,7 @@ class IMP_Quota_Maildir extends IMP_Quota * @return array An array with the following keys: * 'limit' = Maximum quota allowed * 'usage' = Currently used portion of quota (in bytes) - * @throws Horde_Exception + * @throws IMP_Exception */ public function getQuota() { @@ -56,7 +56,7 @@ class IMP_Quota_Maildir extends IMP_Quota // Read in the quota file and parse it, if possible. if (!is_file($full)) { - throw new Horde_Exception(_("Unable to retrieve quota")); + throw new IMP_Exception(_("Unable to retrieve quota")); } // Read in maildir quota file. diff --git a/imp/lib/Quota/Mdaemon.php b/imp/lib/Quota/Mdaemon.php index 9ce8adb59..110972cb9 100644 --- a/imp/lib/Quota/Mdaemon.php +++ b/imp/lib/Quota/Mdaemon.php @@ -24,7 +24,7 @@ class IMP_Quota_Mdaemon extends IMP_Quota * @return array An array with the following keys: * 'limit' = Maximum quota allowed * 'usage' = Currently used portion of quota (in bytes) - * @throws Horde_Exception + * @throws IMP_Exception */ public function getQuota() { @@ -43,7 +43,7 @@ class IMP_Quota_Mdaemon extends IMP_Quota } } - throw new Horde_Exception(_("Unable to retrieve quota")); + throw new IMP_Exception(_("Unable to retrieve quota")); } /** diff --git a/imp/lib/Quota/Mercury32.php b/imp/lib/Quota/Mercury32.php index c6738a535..03de2114e 100644 --- a/imp/lib/Quota/Mercury32.php +++ b/imp/lib/Quota/Mercury32.php @@ -42,6 +42,7 @@ class IMP_Quota_Mercury32 extends IMP_Quota * @return array An array with the following keys: * 'limit' = Maximum quota allowed * 'usage' = Currently used portion of quota (in bytes) + * @throws IMP_Exception */ public function getQuota() { @@ -59,7 +60,7 @@ class IMP_Quota_Mercury32 extends IMP_Quota } } - throw new Horde_Exception(_("Unable to retrieve quota")); + throw new IMP_Exception(_("Unable to retrieve quota")); } } diff --git a/imp/lib/Quota/Sql.php b/imp/lib/Quota/Sql.php index 3964b4d7d..4fe36debe 100644 --- a/imp/lib/Quota/Sql.php +++ b/imp/lib/Quota/Sql.php @@ -39,9 +39,9 @@ class IMP_Quota_Sql extends IMP_Quota protected $_db; /** - * Connects to the database + * Connects to the database. * - * @throws Horde_Exception + * @throws IMP_Exception */ protected function _connect() { @@ -53,7 +53,7 @@ class IMP_Quota_Sql extends IMP_Quota array('persistent' => !empty($this->_params['persistent']), 'ssl' => !empty($this->_params['ssl']))); if ($this->_db instanceof PEAR_Error) { - throw new Horde_Exception(_("Unable to connect to SQL server.")); + throw new IMP_Exception(_("Unable to connect to SQL server.")); } } @@ -63,7 +63,7 @@ class IMP_Quota_Sql extends IMP_Quota * @return array An array with the following keys: * 'limit' = Maximum quota allowed * 'usage' = Currently used portion of quota (in bytes) - * @throws Horde_Exception + * @throws IMP_Exception */ public function getQuota() { @@ -82,7 +82,7 @@ class IMP_Quota_Sql extends IMP_Quota $this->_params['query_quota']); $result = $this->_db->query($query); if ($result instanceof PEAR_Error) { - throw new Horde_Exception_Prior($result); + throw new IMP_Exception($result); } $row = $result->fetchRow(DB_FETCHMODE_ASSOC); @@ -103,7 +103,7 @@ class IMP_Quota_Sql extends IMP_Quota $this->_params['query_used']); $result = $this->_db->query($query); if ($result instanceof PEAR_Error) { - throw new Horde_Exception_Prior($result); + throw new IMP_Exception($result); } $row = $result->fetchRow(DB_FETCHMODE_ASSOC); diff --git a/imp/lib/Sentmail.php b/imp/lib/Sentmail.php index becf75f99..366a511eb 100644 --- a/imp/lib/Sentmail.php +++ b/imp/lib/Sentmail.php @@ -39,7 +39,7 @@ class IMP_Sentmail if (class_exists($class)) { try { return new $class($params); - } catch (Horde_Exception $e) {} + } catch (IMP_Exception $e) {} } } @@ -49,7 +49,7 @@ class IMP_Sentmail /** * Constructor. * - * @throws Horde_Exception + * @throws IMP_Exception */ protected function __construct($params = array()) { @@ -100,7 +100,7 @@ class IMP_Sentmail * A value of null returns all message types. * * @return array A list with the $limit most favourite recipients. - * @throws Horde_Exception + * @throws IMP_Exception */ public function favouriteRecipients($limit, $filter = array('new', 'forward', 'reply', 'redirect')) @@ -116,7 +116,7 @@ class IMP_Sentmail * user? * * @return integer The number of recipients in the given time period. - * @throws Horde_Exception + * @throws IMP_Exception */ public function numberOfRecipients($hours, $user = false) { diff --git a/imp/lib/Sentmail/Sql.php b/imp/lib/Sentmail/Sql.php index f5ece5375..c223618fa 100644 --- a/imp/lib/Sentmail/Sql.php +++ b/imp/lib/Sentmail/Sql.php @@ -40,13 +40,17 @@ class IMP_Sentmail_Sql extends IMP_Sentmail * * @param array $params A hash containing connection parameters. * - * @throws Horde_Exception + * @throws IMP_Exception */ protected function __construct($params = array()) { parent::__construct($params); - Horde::assertDriverConfig($this->_params, 'storage', array('phptype', 'table')); + try { + Horde::assertDriverConfig($this->_params, 'storage', array('phptype', 'table')); + } catch (Horde_Exception $e) { + throw new IMP_Exception($e); + } if (!isset($this->_params['database'])) { $this->_params['database'] = ''; @@ -63,7 +67,7 @@ class IMP_Sentmail_Sql extends IMP_Sentmail array('persistent' => !empty($this->_params['persistent']), 'ssl' => !empty($this->_params['ssl']))); if ($this->_db instanceof PEAR_Error) { - throw new Horde_Exception_Prior($this->_db); + throw new IMP_Exception($this->_db); } /* Set DB portability options. */ @@ -119,7 +123,7 @@ class IMP_Sentmail_Sql extends IMP_Sentmail * A value of null returns all message types. * * @return array A list with the $limit most favourite recipients. - * @throws Horde_Exception + * @throws IMP_Exception */ public function favouriteRecipients($limit, $filter = array('new', 'forward', 'reply', 'redirect')) @@ -144,7 +148,7 @@ class IMP_Sentmail_Sql extends IMP_Sentmail $recipients = $this->_db->getAll($query); if ($recipients instanceof PEAR_Error) { Horde::logMessage($recipients, 'ERR'); - throw new Horde_Exception_Prior($recipients); + throw new IMP_Exception($recipients); } /* Extract email addresses. */ @@ -164,7 +168,7 @@ class IMP_Sentmail_Sql extends IMP_Sentmail * user? * * @return integer The number of recipients in the given time period. - * @throws Horde_Exception + * @throws IMP_Exception */ public function numberOfRecipients($hours, $user = false) { @@ -182,7 +186,7 @@ class IMP_Sentmail_Sql extends IMP_Sentmail $recipients = $this->_db->getOne($query, array(time() - $hours * 3600)); if ($recipients instanceof PEAR_Error) { Horde::logMessage($recipients, 'ERR'); - throw new Horde_Exception_Prior($recipients); + throw new IMP_Exception($recipients); } return $recipients; diff --git a/imp/pgp.php b/imp/pgp.php index a45334b70..543237444 100644 --- a/imp/pgp.php +++ b/imp/pgp.php @@ -35,7 +35,7 @@ case 'process_import_public_key': $imp_pgp->reloadWindow($vars->reload); } catch (Horde_Browser_Exception $e) { $notification->push(_("No PGP public key imported."), 'horde.error'); - throw new Horde_Exception_Prior($e); + throw new IMP_Exception($e); } catch (Horde_Exception $e) { $notification->push($e); $vars->actionID = 'import_public_key'; @@ -75,7 +75,7 @@ case 'process_import_personal_public_key': } } catch (Horde_Browser_Exception $e) { $notification->push(_("No personal PGP public key imported."), 'horde.error'); - throw new Horde_Exception_Prior($e); + throw new IMP_Exception($e); } catch (Horde_Exception $e) { $notification->push($e); $imp_pgp->importKeyDialog('process_import_personal_public_key', $vars->reload); @@ -102,7 +102,7 @@ case 'process_import_personal_private_key': } } catch (Horde_Browser_Exception $e) { $notification->push(_("No personal PGP private key imported."), 'horde.error'); - throw new Horde_Exception_Prior($e); + throw new IMP_Exception($e); } catch (Horde_Exception $e) { $notification->push($e); $imp_pgp->importKeyDialog('process_import_personal_private_key', $vars->reload); diff --git a/imp/smime.php b/imp/smime.php index b54cd6e9c..167083b61 100644 --- a/imp/smime.php +++ b/imp/smime.php @@ -34,7 +34,7 @@ case 'process_import_public_key': $imp_smime->reloadWindow($vars->reload); } catch (Horde_Browser_Exception $e) { $notification->push(_("No S/MIME public key imported."), 'horde.error'); - throw new Horde_Exception_Prior($e); + throw new IMP_Exception($e); } catch (Horde_Exception $e) { $notification->push($e); $vars->actionID = 'import_public_key'; @@ -79,7 +79,7 @@ case 'process_import_personal_certs': $notification->push(_("S/MIME Public/Private Keypair successfully added."), 'horde.success'); $imp_smime->reloadWindow($vars->reload); } catch (Horde_Browser_Exception $e) { - throw new Horde_Exception_Prior($e); + throw new IMP_Exception($e); } catch (Horde_Exception $e) { $notification->push(_("Personal S/MIME certificates NOT imported: ") . $e->getMessage(), 'horde.error'); $vars->actionID = 'import_personal_certs'; -- 2.11.0