Imported Upstream version 3.2.1
[debian/amanda] / perl / Amanda / Changer.pm
index a8891fb5714092ffe5b2e9b0e5c723bc5d0d9789..9c6e88fd05941f8babc9382378df61311ee68b8a 100644 (file)
@@ -859,6 +859,10 @@ sub _new_from_uri { # (note: this sub is patched by the installcheck)
     die "$pkgname->new did not return an Amanda::Changer object or an Amanda::Changer::Error"
        unless ($rv->isa("Amanda::Changer") or $rv->isa("Amanda::Changer::Error"));
 
+    if ($rv->isa("Amanda::Changer::Error")) {
+       return $rv;
+    }
+
     if ($rv->isa("Amanda::Changer")) {
        # add an instance variable or two
        $rv->{'fatal_error'} = undef;
@@ -1032,7 +1036,7 @@ sub make_combined_error {
            reason => $err->{'reason'},
            message => $suberrors->[0][0] . ": " . $err->{'message'});
     } else {
-       my $fatal = $classmeth or grep { $err->[1]{'fatal'} } @$suberrors;
+       my $fatal = $classmeth or grep { $_->[1]{'fatal'} } @$suberrors;
 
        my $reason;
        if (!$fatal) {