Skip to content
Snippets Groups Projects
Commit 4165834f authored by Andrew Dolgov's avatar Andrew Dolgov
Browse files

pluginhost: catch fatal errors in plugin init

parent 9de26d44
No related branches found
No related tags found
No related merge requests found
...@@ -249,23 +249,29 @@ class PluginHost { ...@@ -249,23 +249,29 @@ class PluginHost {
$this->last_registered = $class; $this->last_registered = $class;
switch ($kind) { try {
case $this::KIND_SYSTEM: switch ($kind) {
if ($this->is_system($plugin)) { case $this::KIND_SYSTEM:
if (!$skip_init) $plugin->init($this); if ($this->is_system($plugin)) {
$this->register_plugin($class, $plugin); if (!$skip_init) $plugin->init($this);
} $this->register_plugin($class, $plugin);
break; }
case $this::KIND_USER: break;
if (!$this->is_system($plugin)) { case $this::KIND_USER:
if (!$skip_init) $plugin->init($this); if (!$this->is_system($plugin)) {
$this->register_plugin($class, $plugin); if (!$skip_init) $plugin->init($this);
} $this->register_plugin($class, $plugin);
break; }
case $this::KIND_ALL: break;
if (!$skip_init) $plugin->init($this); case $this::KIND_ALL:
$this->register_plugin($class, $plugin); if (!$skip_init) $plugin->init($this);
break; $this->register_plugin($class, $plugin);
break;
}
} catch (Exception $ex) {
user_error($ex, E_USER_WARNING);
} catch (Error $err) {
user_error($err, E_USER_WARNING);
} }
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment