Log any errors found when calling Shop::Pay->getDrivers, instead of

silently passing them along.
This commit is contained in:
Colin Kuskie 2009-08-20 20:32:00 +00:00
parent ac9be28857
commit 278e4c6461
2 changed files with 8 additions and 2 deletions

View file

@ -1,4 +1,5 @@
7.7.18
- fixed: Logging errors when getting the list of available driver classes.
- fixed #10797: Unable to search for non-ASCII text
- fixed #10800: Ogone payment driver typo
- fixed #10799: Shop: Ogone payment driver- typo

View file

@ -88,8 +88,13 @@ This subroutine returns a hash reference of available shipping driver classes as
sub getDrivers {
my $self = shift;
my %drivers = ();
foreach my $class (@{$self->session->config->get('paymentDrivers')}) {
$drivers{$class} = eval { WebGUI::Pluggable::instanciate($class, 'getName', [ $self->session ])};
CLASS: foreach my $class (@{$self->session->config->get('paymentDrivers')}) {
my $driverName = eval { WebGUI::Pluggable::instanciate($class, 'getName', [ $self->session ])};
if ($@) {
$self->session->log->warn("Error loading $class: $@");
}
next CLASS unless $driverName;
$drivers{$class} = $driverName;
}
return \%drivers;
}