From: Peter Rabbitson Date: Sun, 10 Mar 2013 10:05:06 +0000 (+0100) Subject: Exclude DBICTest namespace from stacktraces X-Git-Tag: v0.08210~24 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=81fecf64c47dd8c31b88e9faeaef000193aed07b;p=dbsrgits%2FDBIx-Class.git Exclude DBICTest namespace from stacktraces --- diff --git a/lib/DBIx/Class/Carp.pm b/lib/DBIx/Class/Carp.pm index 6fac196..d27df5d 100644 --- a/lib/DBIx/Class/Carp.pm +++ b/lib/DBIx/Class/Carp.pm @@ -30,8 +30,6 @@ sub __find_caller { my $fr_num = 1; # skip us and the calling carp* my @f; while (@f = caller($fr_num++)) { - last if $f[0] !~ $skip_pattern; - if ( $f[0]->can('_skip_namespace_frames') and @@ -39,6 +37,8 @@ sub __find_caller { ) { $skip_pattern = qr/$skip_pattern|$extra_skip/; } + + last if $f[0] !~ $skip_pattern; } my ($ln, $calling) = @f # if empty - nothing matched - full stack diff --git a/t/lib/DBICTest/BaseResultSet.pm b/t/lib/DBICTest/BaseResultSet.pm index 946219d..77d22f2 100644 --- a/t/lib/DBICTest/BaseResultSet.pm +++ b/t/lib/DBICTest/BaseResultSet.pm @@ -8,6 +8,7 @@ use warnings; use DBICTest::RunMode; use base 'DBIx::Class::ResultSet'; +__PACKAGE__->_skip_namespace_frames('^DBICTest'); sub all_hri { return [ shift->search ({}, { result_class => 'DBIx::Class::ResultClass::HashRefInflator' })->all ];