X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FDBIx%2FClass%2FStorage.pm;h=48762d145966f108e7c0ce551448be669ab2f8df;hb=52b420dd006f55aced42c669f49182890b8826ea;hp=0575c32fbf24b813c069fb8c393bcfc1da855e86;hpb=0d7d16dd7fa107999e0a89fdbd954a3a261d81e2;p=dbsrgits%2FDBIx-Class.git diff --git a/lib/DBIx/Class/Storage.pm b/lib/DBIx/Class/Storage.pm index 0575c32..48762d1 100644 --- a/lib/DBIx/Class/Storage.pm +++ b/lib/DBIx/Class/Storage.pm @@ -212,23 +212,23 @@ sub txn_do { $coderef->(@args); } $self->txn_commit; - } catch { + } + catch { my $error = shift; try { $self->txn_rollback; } catch { - my $rollback_error = shift; my $exception_class = "DBIx::Class::Storage::NESTED_ROLLBACK_EXCEPTION"; $self->throw_exception($error) # propagate nested rollback - if $rollback_error =~ /$exception_class/; + if $_ =~ /$exception_class/; $self->throw_exception( - "Transaction aborted: $error. Rollback failed: ${rollback_error}" + "Transaction aborted: $error. Rollback failed: $_" ); } $self->throw_exception($error); # txn failed but rollback succeeded - } + }; return $wantarray ? @return_values : $return_value; }