From: Tim Bunce Date: Mon, 23 Mar 2009 12:59:20 +0000 (+0000) Subject: Add debug log in uri_for when uri_for_action returns undef. X-Git-Tag: 5.80001~55 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=commitdiff_plain;h=aa7e913e96898ca59fbf3170d4b9fe1de444e3e5 Add debug log in uri_for when uri_for_action returns undef. --- diff --git a/lib/Catalyst.pm b/lib/Catalyst.pm index 8436e3b..47b4e30 100644 --- a/lib/Catalyst.pm +++ b/lib/Catalyst.pm @@ -1142,8 +1142,13 @@ sub uri_for { my $captures = ( scalar @args && ref $args[0] eq 'ARRAY' ? shift(@args) : [] ); - $path = $c->dispatcher->uri_for_action($path, $captures); - return undef unless defined($path); + my $action = $path; + $path = $c->dispatcher->uri_for_action($action, $captures); + if (not defined $path) { + $c->log->debug(qq/Can't find uri_for action '$action' @$captures/) + if $c->debug; + return undef; + } $path = '/' if $path eq ''; }