This simple augmentation of
ddcc02d1 caught a couple extra spots where a
__DIE__ handler could be incorrectly triggered (one of them ironically
introduced by
86cdddbe which happened *after* the work in ddcc02d1)
See next commit for *YET MORE* of the same...
my $v = $reqs->{$m};
if (! exists $req_unavailability_cache{$m}{$v} ) {
+ # masking this off is important, as it may very well be
+ # a transient error
+ local $SIG{__DIE__} if $SIG{__DIE__};
local $@;
eval( "require $m;" . ( $v ? "$m->VERSION(q($v))" : '' ) );
$req_unavailability_cache{$m}{$v} = $@;
# which will serve as a signal to not try doing anything else
# however beware - on older perls the exception seems randomly untrappable
# due to some weird race condition during thread joining :(((
+ local $SIG{__DIE__} if $SIG{__DIE__};
local $@;
eval {
weaken $_[0]->{schema};
# however beware - on older perls the exception seems randomly untrappable
# due to some weird race condition during thread joining :(((
if (length ref $srcs->{$source_name} and refcount($srcs->{$source_name}) > 1) {
+ local $SIG{__DIE__} if $SIG{__DIE__};
local $@;
eval {
$srcs->{$source_name}->schema($self);
my $g = scope_guard {
- {
- local $@ if DBIx::Class::_ENV_::UNSTABLE_DOLLARAT;
- eval { $self->_dbh->disconnect };
- }
+ defined( $self->_dbh )
+ and dbic_internal_try { $self->_dbh->disconnect };
$self->_dbh(undef);
$self->_dbh_details({});
my ($not_blank, $suberror);
{
+ local $SIG{__DIE__} if $SIG{__DIE__};
local $@;
eval {
# The ne() here is deliberate - a plain length($e), or worse "$e" ne
unless $callstack_state->{in_internal_try};
# always unset - someone may have snuck it in
- local $SIG{__DIE__}
- if $SIG{__DIE__};
-
+ local $SIG{__DIE__} if $SIG{__DIE__};
if( $wantarray ) {
@ret = $try_cref->();
local $SIG{__WARN__} = sigwarn_silencer( qr/\Qisn't numeric in subroutine entry/ )
if SPURIOUS_VERSION_CHECK_WARNINGS;
+ local $SIG{__DIE__} if $SIG{__DIE__};
local $@;
- local $SIG{__DIE__};
eval { $mod->VERSION($ver) } ? 1 : 0;
};
use namespace::clean;
if( $ENV{DBICTEST_ASSERT_NO_SPURIOUS_EXCEPTION_ACTION} ) {
- __PACKAGE__->exception_action( sub {
+ my $ea = __PACKAGE__->exception_action( sub {
my ( $fr_num, $disarmed, $throw_exception_fr_num );
while( ! $disarmed and my @fr = caller(++$fr_num) ) {
) unless $disarmed;
DBIx::Class::Exception->throw( $_[0] );
- })
+ });
+
+ my $interesting_ns_rx = qr/^ (?: main$ | DBIx::Class:: | DBICTest:: ) /x;
+
+ # hard-set $SIG{__DIE__} to the class-wide exception_action
+ # with a little escape preceeding it
+ $SIG{__DIE__} = sub {
+
+ # without this there would be false positives everywhere :(
+ die @_ if (
+ (caller(0))[0] !~ $interesting_ns_rx
+ or
+ (
+ caller(0) eq 'main'
+ and
+ (caller(1))[0] !~ $interesting_ns_rx
+ )
+ );
+
+ &$ea;
+ };
}
sub capture_executed_sql_bind {
# we need to work with a forced fresh clone so that we do not upset any state
# of the main $schema (some tests examine it quite closely)
local $SIG{__WARN__} = sub {};
+ local $SIG{__DIE__};
local $@;
# this will either give us an undef $locktype or will determine things
# on perl < 5.8.3 sometimes a weaken can throw (can't find RT)
# so guard against that unlikely event
+ local $SIG{__DIE__} if $SIG{__DIE__};
local $@;
eval { weaken( $weak_registry->{$refaddr}{weakref} ); $refs_traced++ }
or delete $weak_registry->{$refaddr};
my $type = reftype $r;
+ local $SIG{__DIE__} if $SIG{__DIE__};
local $@;
eval {
if ($type eq 'HASH') {
}
};
+
+ # we are driving manually here, do not allow interference
+ local $SIG{__DIE__} if $SIG{__DIE__};
+
+
no warnings 'redefine';
local *DBIx::Class::Storage::DBI::txn_rollback = sub { die 'die die my darling' };
Class::C3->reinitialize() if DBIx::Class::_ENV_::OLD_MRO;