use List::Util qw/min max reduce/;
use Context::Preserve 'preserve_context';
use Try::Tiny;
+use DBIx::Class::_Util 'dbic_internal_try';
use namespace::clean -except => 'meta';
)],
};
-if (DBIx::Class::_ENV_::DBICTEST) {
+# this only happens during DBIC-internal testing
+if ( $INC{"t/lib/ANFANG.pm"} ) {
my $seen;
for my $type (keys %$method_dispatch) {
my $self = shift;
my $coderef = shift;
- unless( ref $coderef eq 'CODE') {
- $self->throw_exception('Second argument must be a coderef');
- }
+ $self->throw_exception('Second argument must be a coderef')
+ unless( ref $coderef eq 'CODE');
## replace the current read handler for the remainder of the scope
local $self->{read_handler} = $self->master;
- my $args = \@_;
- return try {
- $coderef->(@$args);
- } catch {
- $self->throw_exception("coderef returned an error: $_");
- };
+ &$coderef;
}
=head2 set_reliable_storage