From 5c456b724287f0486b129469ab845948a464fdd3 Mon Sep 17 00:00:00 2001 From: Matthew Musgrove Date: Thu, 2 Nov 2017 15:54:45 -0500 Subject: [PATCH] RT-119863 Improve error message when the related_resultset is not found. --- lib/DBIx/Class/Relationship/Base.pm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/DBIx/Class/Relationship/Base.pm b/lib/DBIx/Class/Relationship/Base.pm index b7e74eb58..9881477ba 100644 --- a/lib/DBIx/Class/Relationship/Base.pm +++ b/lib/DBIx/Class/Relationship/Base.pm @@ -527,7 +527,9 @@ sub related_resultset { my $rsrc = $self->result_source; my $rel_info = $rsrc->relationship_info($rel) - or $self->throw_exception( "No such relationship '$rel'" ); + or $self->throw_exception( + "No such relationship '$rel' on '@{[ $rsrc->source_name ]}' source" + ); my $relcond_is_freeform = ref $rel_info->{cond} eq 'CODE';