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!
Found and individually vetted all remaining eval()s as in:
grep -Pnr -B2 -A7 '^(?!\s*#).*?\beval\b' lib | less
similar produces a large warning
- Make sure exception objects stringifying to '' are properly handled
and warned about (GH#15)
+ - Fix silencing of exceptions thrown by custom inflate_result() methods
- Fix incorrect data returned in a corner case of partial-select HRI
invocation (no known manifestations of this bug in the field, see
commit message for description of exact failure scenario)
: '@$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 Test::Exception;
use DBICTest;
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;