use base qw/DBIx::Class::Componentised DBIx::Class::AccessorGroup/;
use DBIx::Class::StartupCheck;
+use DBIx::Class::Exception;
__PACKAGE__->mk_group_accessors(inherited => '_skip_namespace_frames');
__PACKAGE__->_skip_namespace_frames('^DBIx::Class|^SQL::Abstract|^Try::Tiny|^Class::Accessor::Grouped|^Context::Preserve');
use warnings;
use base qw/DBIx::Class/;
use DBIx::Class::Carp;
-use DBIx::Class::Exception;
use DBIx::Class::ResultSetColumn;
use Scalar::Util qw/blessed weaken/;
use Try::Tiny;
use base 'DBIx::Class';
use DBIx::Class::Carp;
-use DBIx::Class::Exception;
# not importing first() as it will clash with our own method
use List::Util ();
=cut
sub throw_exception {
- my $self=shift;
+ my $self = shift;
if (ref $self && $self->{_parent_resultset}) {
$self->{_parent_resultset}->throw_exception(@_);
use DBIx::Class::ResultSet;
use DBIx::Class::ResultSourceHandle;
-use DBIx::Class::Exception;
use DBIx::Class::Carp;
use Devel::GlobalDestruction;
use Try::Tiny;
use base qw/DBIx::Class/;
-use DBIx::Class::Exception;
use Try::Tiny;
-
use namespace::clean;
use overload
use base qw/DBIx::Class/;
-use DBIx::Class::Exception;
use Scalar::Util 'blessed';
use List::Util 'first';
use Try::Tiny;
use Sub::Name 'subname';
use DBIx::Class::Carp;
-use DBIx::Class::Exception;
use namespace::clean;
__PACKAGE__->mk_group_accessors (simple => qw/quote_char name_sep limit_dialect/);
use strict;
use warnings;
-use DBIx::Class::Exception;
use DBIx::Class::Carp;
use Try::Tiny;
use Scalar::Util qw/weaken blessed/;
=cut
-my $false_exception_action_warned;
sub throw_exception {
my $self = shift;
." (original error: $_[0])"
);
}
- elsif(! $false_exception_action_warned++) {
- carp (
- "The exception_action handler installed on $self returned false instead"
- .' of throwing an exception. This behavior has been deprecated, adjust your'
- .' handler to always rethrow the supplied error.'
- );
- }
+
+ carp_unique (
+ "The exception_action handler installed on $self returned false instead"
+ .' of throwing an exception. This behavior has been deprecated, adjust your'
+ .' handler to always rethrow the supplied error.'
+ );
}
DBIx::Class::Exception->throw($_[0], $self->stacktrace);
default => quote_sub(q{ 0 }),
lazy => 1,
trigger => quote_sub(q{
- DBIx::Class::Exception->throw(sprintf (
+ $_[0]->throw_exception( sprintf (
'Exceeded max_retried_count amount of %d, latest exception: %s',
$_[0]->max_retried_count, $_[0]->last_exception
)) if $_[0]->max_retried_count < ($_[1]||0);
sub last_exception { shift->exception_stack->[-1] }
+sub throw_exception { shift->storage->throw_exception (@_) }
+
sub run {
my $self = shift;
- DBIx::Class::Exception->throw('run() takes no arguments') if @_;
+ $self->throw_exception('run() takes no arguments') if @_;
$self->_reset_exception_stack;
$self->_reset_retried_count;
use mro 'c3';
use DBIx::Class::Carp;
-use DBIx::Class::Exception;
use Scalar::Util qw/refaddr weaken reftype blessed/;
use List::Util qw/first/;
use Sub::Name 'subname';