From: Peter Rabbitson Date: Mon, 27 Dec 2010 03:41:14 +0000 (+0100) Subject: Latest blead (5.13.8) allows us to see $@ again X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=e69b53350cbc835b0de96f0c1f9af4e31ac94fdd;hp=6b01a153cf11b6f4b3a07434cf90719e63c5950c;p=dbsrgits%2FDBIx-Class-Historic.git Latest blead (5.13.8) allows us to see $@ again ... but does not allow us to change it still (it is set twice), this is something that the SIG wrapper will take care of once viable. --- diff --git a/Changes b/Changes index 2870ce9..ac8980a 100644 --- a/Changes +++ b/Changes @@ -55,6 +55,8 @@ Revision history for DBIx::Class - Fix incorrect 'having' attribute documentation (RT#64129) - Improve fallback-to-master/return-to-slave reporting in ::Replicated::Balancer + - Adjust txn_scope_guard code/tests to changes in $@ handling on + recent blead (RT#64251) * Misc - Add extra option groups to DBIC::Optional::Depencencies, to aid diff --git a/lib/DBIx/Class/Storage/TxnScopeGuard.pm b/lib/DBIx/Class/Storage/TxnScopeGuard.pm index 9bda8bb..843ad91 100644 --- a/lib/DBIx/Class/Storage/TxnScopeGuard.pm +++ b/lib/DBIx/Class/Storage/TxnScopeGuard.pm @@ -12,14 +12,11 @@ use namespace::clean; # we also need a real appendable, stackable exception object # (coming soon) BEGIN { - if ($] < 5.013001) { - *IS_BROKEN_PERL = sub () { 0 }; - } - elsif ($] < 5.013008) { + if ($] >= 5.013001 and $] <= 5.013007) { *IS_BROKEN_PERL = sub () { 1 }; } else { - die 'The $@ debacle should have been resolved by now, adjust DBIC'; + *IS_BROKEN_PERL = sub () { 0 }; } } diff --git a/t/storage/txn_scope_guard.t b/t/storage/txn_scope_guard.t index dbfc6a4..f79ff8d 100644 --- a/t/storage/txn_scope_guard.t +++ b/t/storage/txn_scope_guard.t @@ -104,7 +104,10 @@ use DBICTest; #$schema->storage->_dbh( $schema->storage->_dbh->clone ); die 'Deliberate exception'; - }, qr/Deliberate exception.+Rollback failed/s); + }, ($] >= 5.013008 ) + ? qr/Deliberate exception/s # temporary until we get the generic exception wrapper rolling + : qr/Deliberate exception.+Rollback failed/s + ); # just to mask off warning since we could not disconnect above $schema->storage->_dbh->disconnect;