Try to catch some errors

This commit is contained in:
Nathan Gray
2013-01-03 17:00:56 +00:00
parent 61ff62f899
commit a40dda009e
2 changed files with 11 additions and 3 deletions

View File

@ -79,7 +79,8 @@ class importexport_arrayxml {
$n = &$_xml; $n = &$_xml;
} else { } else {
$n = new DOMDocument; $n = new DOMDocument;
$n->loadXML($_xml); $loaded = $n->loadXML($_xml);
if(!$loaded) return array();
} }
$xml_array = array(); $xml_array = array();

View File

@ -77,9 +77,16 @@ class importexport_definition implements importexport_iface_egw_record {
if ( !( importexport_definitions_bo::is_permitted($this->get_record_array()) || $this->is_admin)) { if ( !( importexport_definitions_bo::is_permitted($this->get_record_array()) || $this->is_admin)) {
throw new Exception('Error: User "'.$this->user.'" is not permitted to get definition with identifier "'.$_identifier.'"!'); throw new Exception('Error: User "'.$this->user.'" is not permitted to get definition with identifier "'.$_identifier.'"!');
} }
try
{
$options_data = importexport_arrayxml::xml2array( $this->definition['plugin_options'] ); $options_data = importexport_arrayxml::xml2array( $this->definition['plugin_options'] );
$this->definition['plugin_options'] = $options_data['root']; $this->definition['plugin_options'] = $options_data['root'];
} }
catch (Exception $e)
{
error_log($e->getMessage());
}
}
} }
/** /**