File tree Expand file tree Collapse file tree 4 files changed +22
-2
lines changed Expand file tree Collapse file tree 4 files changed +22
-2
lines changed Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ Revision history for DBIx::Class
3
3
* Fixes
4
4
- Fix incorrect collapsing-parser source being generated in the
5
5
presence of unicode data among the collapse-points
6
+ - Fix endless loop on BareSourcelessResultClass->throw_exception(...)
6
7
7
8
* Misc
8
9
- Depend on newer Moo, fixing some interoperability issues:
Original file line number Diff line number Diff line change @@ -1564,8 +1564,8 @@ See L<DBIx::Class::Schema/throw_exception>.
1564
1564
sub throw_exception {
1565
1565
my $self =shift ;
1566
1566
1567
- if (ref $self && ref $ self-> result_source ) {
1568
- $self -> result_source -> throw_exception(@_ )
1567
+ if (ref $self && ref ( my $rsrc = try { $ self-> result_source_instance } ) ) {
1568
+ $rsrc -> throw_exception(@_ )
1569
1569
}
1570
1570
else {
1571
1571
DBIx::Class::Exception-> throw(@_ );
Original file line number Diff line number Diff line change @@ -636,4 +636,6 @@ SKIP: {
636
636
637
637
throws_ok { $schema -> resultset} qr / resultset\(\) expects a source name/ , ' resultset with no argument throws exception' ;
638
638
639
+ throws_ok { $schema -> source(' Artist' )-> result_class-> new( ' bugger' ) } qr / must be a hashref/ ;
640
+
639
641
done_testing;
Original file line number Diff line number Diff line change
1
+ use strict;
2
+ use warnings;
3
+
4
+ use Test::More;
5
+ use Test::Exception;
6
+
7
+ use lib ' t/lib' ;
8
+ use DBICTest;
9
+
10
+ {
11
+ package DBICTest::Foo ;
12
+ use base " DBIx::Class::Core" ;
13
+ }
14
+
15
+ throws_ok { DBICTest::Foo-> new(" urgh" ) } qr / must be a hashref/ ;
16
+
17
+ done_testing;
You can’t perform that action at this time.
0 commit comments