MDL-16405 - throw the right exception during admin operations to avoid unnecessary debugging notice.

This commit is contained in:
mjollnir_
2008-09-09 13:44:16 +00:00
parent 237d80e06e
commit a200c487f2
+4 -1
View File
@@ -644,7 +644,10 @@ abstract class portfolio_plugin_base {
return true;
}
$a = (object)array('property' => $field, 'class' => get_class($this));
throw new portfolio_export_exception($this->get('exporter'), 'invalidproperty', 'portfolio', null, $a);
if ($this->get('exporter')) {
throw new portfolio_export_exception($this->get('exporter'), 'invalidproperty', 'portfolio', null, $a);
}
throw new portfolio_exception('invalidproperty', 'portfolio', null, $a); // this happens outside export (eg admin settings)
}