From: Daniel Westermann-Clark Date: Mon, 20 Mar 2006 22:30:26 +0000 (+0000) Subject: Fix exception text for nonexistent key in ResultSet::find() X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=5bd6785c8266519371d60ad51306f938b648033d;p=dbsrgits%2FDBIx-Class-Historic.git Fix exception text for nonexistent key in ResultSet::find() --- diff --git a/Changes b/Changes index 398f881..53d01f9 100644 --- a/Changes +++ b/Changes @@ -3,6 +3,7 @@ Revision history for DBIx::Class 0.05999_05 - Fixup to columns_info_for when database returns type(size) - Made do_txn respect void context (on the off-chance somebody cares) + - Fix exception text for nonexistent key in ResultSet::find() 0.05999_04 - Fix for delete on full-table resultsets diff --git a/lib/DBIx/Class/ResultSet.pm b/lib/DBIx/Class/ResultSet.pm index da955a4..da9dced 100644 --- a/lib/DBIx/Class/ResultSet.pm +++ b/lib/DBIx/Class/ResultSet.pm @@ -252,7 +252,7 @@ sub find { my @cols = $self->result_source->primary_columns; if (exists $attrs->{key}) { my %uniq = $self->result_source->unique_constraints; - $self->throw_exception( "Unknown key $attrs->{key} on $self->name" ) + $self->throw_exception( "Unknown key $attrs->{key} on '" . $self->result_source->name . "'" ) unless exists $uniq{$attrs->{key}}; @cols = @{ $uniq{$attrs->{key}} }; }