diff options
| author | 2025-04-01 17:55:20 +0200 | |
|---|---|---|
| committer | 2025-04-01 17:55:20 +0200 | |
| commit | 3336631a846c2e34f55b2ecb76b46cd68228486f (patch) | |
| tree | c2672609f84d57c1bf7c3c338a1369ff5748bff0 /lib/Minz/ExtensionManager.php | |
| parent | dbdadbb4107878d9233f635c31a88afe45957101 (diff) | |
Catch extension exceptions in override (#7475)
* Catch extension exceptions in override
https://github.com/FreshRSS/Extensions/pull/300#issuecomment-2768578464
* Fix error message
Diffstat (limited to 'lib/Minz/ExtensionManager.php')
| -rw-r--r-- | lib/Minz/ExtensionManager.php | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/Minz/ExtensionManager.php b/lib/Minz/ExtensionManager.php index 84a6fc09f..fea1f5879 100644 --- a/lib/Minz/ExtensionManager.php +++ b/lib/Minz/ExtensionManager.php @@ -268,7 +268,13 @@ final class Minz_ExtensionManager { spl_autoload_register([$ext, 'autoload']); } $ext->enable(); - $ext->init(); + try { + $ext->init(); + } catch (Minz_Exception $e) { // @phpstan-ignore catch.neverThrown (Thrown by extensions) + Minz_Log::warning('Error while enabling extension ' . $ext->getName() . ': ' . $e->getMessage()); + $ext->disable(); + unset(self::$ext_list_enabled[$ext_name]); + } } } |
