X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FDBIx%2FClass%2FValidation.pm;h=b51c9c8fcbd5b8f9df40f34575dda70a127db4dc;hb=1c258fc1b3bc48e162b6b05e325625d6a75cb217;hp=4b830671f8db5378256fd1cbf85521cd4f5a8930;hpb=e430cbebb14df385e2a94848714e94d9521c179c;p=dbsrgits%2FDBIx-Class-Historic.git diff --git a/lib/DBIx/Class/Validation.pm b/lib/DBIx/Class/Validation.pm index 4b83067..b51c9c8 100644 --- a/lib/DBIx/Class/Validation.pm +++ b/lib/DBIx/Class/Validation.pm @@ -4,10 +4,10 @@ use strict; 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. +#local $^W = 0; # Silence C:D:I redefined sub errors. +# Switched to C::D::Accessor which doesn't do this. Hate hate hate hate. our $VERSION = '0.01'; @@ -20,8 +20,8 @@ sub validation_module { 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 ); } @@ -42,7 +42,7 @@ sub validate { my $profile = $self->validation_profile(); my $result = $module->check( \%data => $profile ); return $result if ($result->success()); - croak( $result ); + $self->throw_exception( $result ); } sub insert {