use warnings;
use base qw( DBIx::Class );
-use Carp qw( croak );
use English qw( -no_match_vars );
#local $^W = 0; # Silence C:D:I redefined sub errors.
my $module = shift;
eval("use $module");
- croak("Unable to load the validation module '$module' because $EVAL_ERROR") if ($EVAL_ERROR);
- croak("The '$module' module does not support the check method") if (!$module->can('check'));
+ $class->throw_exception("Unable to load the validation module '$module' because $EVAL_ERROR") if ($EVAL_ERROR);
+ $class->throw_exception("The '$module' module does not support the check method") if (!$module->can('check'));
$class->_validation_module_accessor( $module );
}
my $profile = $self->validation_profile();
my $result = $module->check( \%data => $profile );
return $result if ($result->success());
- croak( $result );
+ $self->throw_exception( $result );
}
sub insert {