When the `install()` process fails, it throws a `Koha::Exceptions::Plugin::InstallDied` exception. But it only carries the `plugin_class` value. We need to pass the error from the `try/catch` block so it gets returned to the caller as well.
Created attachment 180930 [details] [review] Bug 39632: Extend plugin exceptions with more useful parameters This patch tweaks the `Koha::Exceptions::Plugin` class by adding an extra parameter to the plugin install and upgrade related exceptions so they carry the actuall error (if any). * Koha::Exceptions::Plugin::InstallDied: install_error * Koha::Exceptions::Plugin::UpgradeDied: upgrade_error I didn't pick plain 'error' because it is a reserved word for `Exception::Class` which makes it stringify using its value only. To test: 1. Apply this patch 2. Run: $ ktd --shell k$ prove t/Koha/Exceptions.t => SUCCESS: Tests pass! 3. Sign off :-D
Created attachment 180931 [details] [review] Bug 39632: Make plugin install and upgrade errors more useful This patch makes the install and upgrade process for plugins to add the newly added extra parameters to the thrown exceptions. This is covered by the tests To test: 1. Apply this patch 2. Run: $ ktd --shell k$ prove -r t/Koha/Exceptions.t \ t/db_dependent/Koha/Plugins => SUCCESS: Tests pass! 3. Sign off :-D
Created attachment 180942 [details] [review] Bug 39632: Extend plugin exceptions with more useful parameters This patch tweaks the `Koha::Exceptions::Plugin` class by adding an extra parameter to the plugin install and upgrade related exceptions so they carry the actuall error (if any). * Koha::Exceptions::Plugin::InstallDied: install_error * Koha::Exceptions::Plugin::UpgradeDied: upgrade_error I didn't pick plain 'error' because it is a reserved word for `Exception::Class` which makes it stringify using its value only. To test: 1. Apply this patch 2. Run: $ ktd --shell k$ prove t/Koha/Exceptions.t => SUCCESS: Tests pass! 3. Sign off :-D Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
Created attachment 180943 [details] [review] Bug 39632: Make plugin install and upgrade errors more useful This patch makes the install and upgrade process for plugins to add the newly added extra parameters to the thrown exceptions. This is covered by the tests To test: 1. Apply this patch 2. Run: $ ktd --shell k$ prove -r t/Koha/Exceptions.t \ t/db_dependent/Koha/Plugins => SUCCESS: Tests pass! 3. Sign off :-D Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>