From: Peter Rabbitson Date: Wed, 9 Sep 2009 12:42:49 +0000 (+0000) Subject: Really sanify exception text X-Git-Tag: v0.08112~37 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=8bbfe6b24770ef48b722f3b018500ada5fed29cd;p=dbsrgits%2FDBIx-Class.git Really sanify exception text --- diff --git a/lib/DBIx/Class/ResultSource.pm b/lib/DBIx/Class/ResultSource.pm index 122faef..59db157 100644 --- a/lib/DBIx/Class/ResultSource.pm +++ b/lib/DBIx/Class/ResultSource.pm @@ -1322,10 +1322,14 @@ sub _resolve_condition { #warn "$self $k $for $v"; unless ($for->has_column_loaded($v)) { if ($for->in_storage) { - $self->throw_exception( - "Unable to resolve relationship to ${for}: column ${v} not " - . "loaded from storage (or not passed to new() prior to insert()). " - . "Maybe you forgot to call ->discard_changes to get defaults from the db." + $self->throw_exception(sprintf + 'Unable to resolve relationship from %s to %s: column %s.%s not ' + . 'loaded from storage (or not passed to new() prior to insert()). ' + . 'Maybe you forgot to call ->discard_changes to get defaults from the db.', + + $for->result_source->source_name, + $as, + $as, $v, ); } return $UNRESOLVABLE_CONDITION;