( cherry-pick of
b4976ee31 )
The reason this has not been detected is because it is virtually impossible
for the stock inflate_result() to throw, and pretty rare for custom ones.
ARGH!
- Fix use of ::Schema::Versioned combined with a user-supplied
$dbh->{HandleError} (GH#101)
- Fix parsing of DSNs containing driver arguments (GH#99)
+ - Fix silencing of exceptions thrown by custom inflate_result() methods
- Fix spurious ROLLBACK statements when a TxnScopeGuard fails a commit
of a transaction with deferred FK checks: a guard is now inactivated
immediately before the commit is attempted (RT#107159)
: '@$rows = map { $inflator_cref->($res_class, $rsrc, { %s } ) } @$rows'
),
( join (', ', map { "\$infmap->[$_] => \$_->[$_]" } 0..$#$infmap ) )
- );
+ ) . '; 1' or die;
}
}
else {
use Test::More;
use Test::Deep;
use lib qw(t/lib);
+use Test::Exception;
+
use DBICTest;
my $schema = DBICTest->init_schema(no_populate => 1);
cmp_deeply($left, $right, $msg||()) or next INFTYPE;
}
+
{
package DBICTest::_DoubleResult;
})->all_hri}) x 2 ],
);
+
+{
+ package DBICTest::_DieTrying;
+
+ sub inflate_result {
+ die "nyah nyah nyah";
+ }
+}
+
+throws_ok {
+ $schema->resultset('CD')->search({}, { result_class => 'DBICTest::_DieTrying' })->all
+} qr/nyah nyah nyah/, 'Exception in custom inflate_result propagated correctly';
+
+
done_testing;