Subject: | Log::Report::Exception overloading doesn't fallback |
I've hit a case where a Log::Report::Exception was raised within the context of a DBIx::Class txn_do() call.
The application in question doesn't use the latest version of DBIx::Class, so this results in the rather unhelpful error message:
DBIx::Class::Schema::txn_do(): Operation "ne": no method found,
left argument in overloaded package Log::Report::Dispatcher::Try,
right argument has no overloaded magic at /usr/lib64/perl5/vendor_perl/5.12.4/DBIx/Class/Storage/TxnScopeGuard.pm line 22.
This is triggered by the line "if (defined $@ and $@ ne '')" in DBIx::Class::Storage::TxnScopeGuard.
Newer versions of DBIx::Class do this:
https://metacpan.org/source/RIBASUSHI/DBIx-Class-0.08270/lib/DBIx/Class/_Util.pm#L83
i.e. it prints a warning and recommends that the exception class 'use overload fallback => 1;' in order to make exception handling more sane.
Could you change
use overload '""' => 'toString';
to
use overload '""' => 'toString', fallback => 1;
?