so that test relying on the order of %{} will no longer fail
- Fixed mysterious ::Storage::DBI goto-shim failures on older
perl versions
+ - Non-blessed reference exceptions are now correctly preserved
+ when thrown from udner DBIC (e.g. from txn_do)
* Misc
- Refactored capability handling in Storage::DBI, allows for
use warnings;
use Carp::Clan qw/^DBIx::Class|^Try::Tiny/;
-use Scalar::Util qw/blessed/;
use Try::Tiny;
use namespace::clean;
my ($class, $msg, $stacktrace) = @_;
# Don't re-encapsulate exception objects of any kind
- die $msg if blessed($msg);
+ die $msg if ref($msg);
# use Carp::Clan's croak if we're not stack tracing
if(!$stacktrace) {
--- /dev/null
+use strict;
+use warnings;
+
+use Test::More;
+use Test::Exception;
+
+use lib qw(t/lib);
+
+use DBICTest;
+my $schema = DBICTest->init_schema;
+
+throws_ok (sub {
+ $schema->txn_do (sub { die 'lol' } );
+}, 'DBIx::Class::Exception', 'a DBIC::Exception object thrown');
+
+throws_ok (sub {
+ $schema->txn_do (sub { die [qw/lol wut/] });
+}, qr/ARRAY\(0x/, 'An arrayref thrown');
+
+is_deeply (
+ $@,
+ [qw/ lol wut /],
+ 'Exception-arrayref contents preserved',
+);
+
+done_testing;