From dd960a128c423d25d7225a70b1c8f5d28b4db02f Mon Sep 17 00:00:00 2001 From: Michael J Rubinsky Date: Fri, 7 Jan 2011 14:23:39 -0500 Subject: [PATCH] this throws a Turba_Exception, not a PEAR_Error --- turba/addressbooks/create.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/turba/addressbooks/create.php b/turba/addressbooks/create.php index 61cad1d35..ecfcc0cd0 100644 --- a/turba/addressbooks/create.php +++ b/turba/addressbooks/create.php @@ -24,11 +24,11 @@ $form = new Turba_Form_CreateAddressBook($vars); // Execute if the form is valid. if ($form->validate($vars)) { - $result = $form->execute(); - if ($result instanceof PEAR_Error) { - $notification->push($result, 'horde.error'); - } else { + try { + $result = $form->execute(); $notification->push(sprintf(_("The address book \"%s\" has been created."), $vars->get('name')), 'horde.success'); + } catch (Turba_Exception $e) { + $notification->push($e, 'horde.error'); } Horde::url('addressbooks/', true)->redirect(); -- 2.11.0