From: Michael J Rubinsky Date: Fri, 7 Jan 2011 19:23:39 +0000 (-0500) Subject: this throws a Turba_Exception, not a PEAR_Error X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=dd960a128c423d25d7225a70b1c8f5d28b4db02f;p=horde.git this throws a Turba_Exception, not a PEAR_Error --- 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();