From: Gunnar Wrobel
Date: Mon, 29 Jun 2009 05:44:07 +0000 (+0200) Subject: Correct catching errors. X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=42f850acb04d7a6e291e8d4497c8bc47e6535da8;p=horde.git Correct catching errors. --- diff --git a/framework/Kolab_Format/lib/Horde/Kolab/Format/XML.php b/framework/Kolab_Format/lib/Horde/Kolab/Format/XML.php index 40265129d..080d161f5 100644 --- a/framework/Kolab_Format/lib/Horde/Kolab/Format/XML.php +++ b/framework/Kolab_Format/lib/Horde/Kolab/Format/XML.php @@ -427,8 +427,9 @@ class Horde_Kolab_Format_XML */ public function load(&$xmltext) { - $noderoot = $this->_parseXml($xmltext); - if (is_a($noderoot, 'PEAR_Error') || empty($noderoot)) { + try { + $noderoot = $this->_parseXml($xmltext); + } catch (Horde_Exception $e) { /** * If the first call does not return successfully this might mean we * got an attachment with broken encoding. There are some Kolab @@ -442,10 +443,6 @@ class Horde_Kolab_Format_XML } $noderoot = $this->_parseXml($xmltext); } - - if (is_a($noderoot, 'PEAR_Error')) { - throw new Horde_Exception($noderoot); - } if (empty($noderoot)) { return false; }