From: Arthur Axel 'fREW' Schmidt Date: Fri, 29 Oct 2010 01:40:24 +0000 (-0500) Subject: Add error checking on "profile" for SQLA::Tree X-Git-Tag: v1.70~10 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=1c33db5d0ccacdfc4d6028ec596b0f34a045471c;p=dbsrgits%2FSQL-Abstract.git Add error checking on "profile" for SQLA::Tree --- diff --git a/Changes b/Changes index 6c3be78..01a5662 100644 --- a/Changes +++ b/Changes @@ -1,5 +1,6 @@ Revision history for SQL::Abstract + - Add error checking on "profile" for SQLA::Tree - Hide bulk inserts from DBIx::Class - Highlight transaction keywords - Highlight HAVING diff --git a/lib/SQL/Abstract/Tree.pm b/lib/SQL/Abstract/Tree.pm index 5bfcc67..f6076ba 100644 --- a/lib/SQL/Abstract/Tree.pm +++ b/lib/SQL/Abstract/Tree.pm @@ -284,6 +284,9 @@ sub new { my $args = shift || {}; my $profile = delete $args->{profile} || 'none'; + + die "No such profile '$profile'!" unless exists $profiles{$profile}; + my $data = $merger->merge( $profiles{$profile}, $args ); bless $data, $class