Catch extension exceptions in override (#7475)

* Catch extension exceptions in override
https://github.com/FreshRSS/Extensions/pull/300#issuecomment-2768578464

* Fix error message
This commit is contained in:
Alexandre Alapetite authored and GitHub committed 2025-04-01 17:55:20 +02:00
1 parent dbdadbb410
commit 3336631a84
3 files changed
+19 -2

No files matched your search

+6 -1
View File
@@ -131,7 +131,12 @@ class FreshRSS_extension_Controller extends FreshRSS_ActionController {
FreshRSS_View::prependTitle($ext->getName() . ' · ' . _t('admin.extensions.title') . ' · ');
$this->view->extension = $ext;
$this->view->extension->handleConfigureAction();
try {
$this->view->extension->handleConfigureAction();
} catch (Minz_Exception $e) { // @phpstan-ignore catch.neverThrown (Thrown by extensions)
Minz_Log::error('Error while configuring extension ' . $ext->getName() . ': ' . $e->getMessage());
Minz_Request::bad(_t('feedback.extensions.enable.ko', $ext_name, _url('index', 'logs')), ['c' => 'extension', 'a' => 'index']);
}
}
/**