Bugzilla – Attachment 180943 Details for
Bug 39632
Failed plugin install gives too little info
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 39632: Make plugin install and upgrade errors more useful
Bug-39632-Make-plugin-install-and-upgrade-errors-m.patch (text/plain), 2.60 KB, created by
Brendan Gallagher
on 2025-04-14 21:18:30 UTC
(
hide
)
Description:
Bug 39632: Make plugin install and upgrade errors more useful
Filename:
MIME Type:
Creator:
Brendan Gallagher
Created:
2025-04-14 21:18:30 UTC
Size:
2.60 KB
patch
obsolete
>From 8c8055269270af43c92c10eeff96ab74fd03f0a0 Mon Sep 17 00:00:00 2001 >From: =?UTF-8?q?Tom=C3=A1s=20Cohen=20Arazi?= <tomas@bywatersolutions.com> >Date: Mon, 14 Apr 2025 16:09:34 -0300 >Subject: [PATCH] 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> >--- > Koha/Plugins/Base.pm | 4 ++-- > t/db_dependent/Koha/Plugins/Broken.t | 7 ++++--- > 2 files changed, 6 insertions(+), 5 deletions(-) > >diff --git a/Koha/Plugins/Base.pm b/Koha/Plugins/Base.pm >index 75c628e53d..42f5800e1b 100644 >--- a/Koha/Plugins/Base.pm >+++ b/Koha/Plugins/Base.pm >@@ -62,7 +62,7 @@ sub new { > warn "Plugin $class failed during installation!"; > } > } catch { >- Koha::Exceptions::Plugin::InstallDied->throw( plugin_class => $class ); >+ Koha::Exceptions::Plugin::InstallDied->throw( plugin_class => $class, install_error => "$_" ); > }; > } elsif ( $self->can('upgrade') ) { > if ( _version_compare( $plugin_version, $database_version ) == 1 ) { >@@ -73,7 +73,7 @@ sub new { > warn "Plugin $class failed during upgrade!"; > } > } catch { >- Koha::Exceptions::Plugin::UpgradeDied->throw( plugin_class => $class ); >+ Koha::Exceptions::Plugin::UpgradeDied->throw( plugin_class => $class, upgrade_error => "$_" ); > }; > } > } elsif ( $plugin_version ne $database_version ) { >diff --git a/t/db_dependent/Koha/Plugins/Broken.t b/t/db_dependent/Koha/Plugins/Broken.t >index 8db1861000..dab439b5b3 100755 >--- a/t/db_dependent/Koha/Plugins/Broken.t >+++ b/t/db_dependent/Koha/Plugins/Broken.t >@@ -37,12 +37,13 @@ $schema->storage->txn_begin; > > t::lib::Mocks::mock_config( 'enable_plugins', 1 ); > >-my $plugins = Koha::Plugins->new; >+my $plugins = Koha::Plugins->new; >+my $error_string = 'Why Liz? WHY?'; > > warnings_are { $plugins->InstallPlugins; } > [ >- "Calling 'install' died for plugin Koha::Plugin::BrokenInstall", >- "Calling 'upgrade' died for plugin Koha::Plugin::BrokenUpgrade" >+ "Calling 'install' died for plugin Koha::Plugin::BrokenInstall: $error_string", >+ "Calling 'upgrade' died for plugin Koha::Plugin::BrokenUpgrade: $error_string" > ]; > > $schema->storage->txn_begin; >-- >2.39.5
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 39632
:
180930
|
180931
|
180942
| 180943