Lines 31-37
use Exception::Class (
Link Here
|
31 |
isa => 'Koha::Exceptions::Plugin', |
31 |
isa => 'Koha::Exceptions::Plugin', |
32 |
description => 'Required method is missing', |
32 |
description => 'Required method is missing', |
33 |
fields => ['plugin_name','method'] |
33 |
fields => ['plugin_name','method'] |
34 |
} |
34 |
}, |
|
|
35 |
'Koha::Exceptions::Plugin::InstallDied' => { |
36 |
isa => 'Koha::Exceptions::Plugin', |
37 |
description => 'The plugin died on install', |
38 |
fields => ['plugin_class'], |
39 |
}, |
40 |
'Koha::Exceptions::Plugin::UpgradeDied' => { |
41 |
isa => 'Koha::Exceptions::Plugin', |
42 |
description => 'The plugin died on upgrade', |
43 |
fields => ['plugin_class'], |
44 |
}, |
35 |
); |
45 |
); |
36 |
|
46 |
|
37 |
sub full_message { |
47 |
sub full_message { |
Lines 43-48
sub full_message {
Link Here
|
43 |
if ( $self->isa('Koha::Exceptions::Plugin::MissingMethod') ) { |
53 |
if ( $self->isa('Koha::Exceptions::Plugin::MissingMethod') ) { |
44 |
$msg = sprintf("Cannot use plugin (%s) because the it doesn't implement the '%s' method which is required.", $self->plugin_name, $self->method ); |
54 |
$msg = sprintf("Cannot use plugin (%s) because the it doesn't implement the '%s' method which is required.", $self->plugin_name, $self->method ); |
45 |
} |
55 |
} |
|
|
56 |
elsif ( $self->isa('Koha::Exceptions::Plugin::InstallDied') ) { |
57 |
$msg = sprintf("Calling 'install' died for plugin %s", $self->plugin_class); |
58 |
} |
59 |
elsif ( $self->isa('Koha::Exceptions::Plugin::UpgradeDied') ) { |
60 |
$msg = sprintf("Calling 'upgrade' died for plugin %s", $self->plugin_class); |
61 |
} |
46 |
} |
62 |
} |
47 |
|
63 |
|
48 |
return $msg; |
64 |
return $msg; |
Lines 73-78
method and it doesn't.
Link Here
|
73 |
|
89 |
|
74 |
=back |
90 |
=back |
75 |
|
91 |
|
|
|
92 |
=head2 Koha::Exceptions::Plugin::InstallDied |
93 |
|
94 |
Exception to be used when a plugin 'install' method explodes. |
95 |
|
96 |
=head3 Parameters |
97 |
|
98 |
=over |
99 |
|
100 |
=item plugin_class: the plugin class |
101 |
|
102 |
=back |
103 |
|
104 |
=head2 Koha::Exceptions::Plugin::UpgradeDied |
105 |
|
106 |
Exception to be used when a plugin 'upgrade' method explodes. |
107 |
|
108 |
=head3 Parameters |
109 |
|
110 |
=over |
111 |
|
112 |
=item plugin_class: the plugin class |
113 |
|
114 |
=back |
115 |
|
76 |
=head1 Class methods |
116 |
=head1 Class methods |
77 |
|
117 |
|
78 |
=head2 full_message |
118 |
=head2 full_message |