From: Graham Knop Date: Sun, 21 Oct 2018 03:17:18 +0000 (+0200) Subject: use debug warnings rather than carp when uri_for args are wrong type X-Git-Tag: v5.90_121~6 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=commitdiff_plain;h=0d42b769cb502cae1587cbe8e606ea15921508d2 use debug warnings rather than carp when uri_for args are wrong type --- diff --git a/lib/Catalyst.pm b/lib/Catalyst.pm index c6ccc59..92ec180 100644 --- a/lib/Catalyst.pm +++ b/lib/Catalyst.pm @@ -1640,8 +1640,9 @@ sub uri_for { if($num_captures) { unless($expanded_action->match_captures_constraints($c, $captures)) { - carp "captures [@{$captures}] do not match the type constraints in actionchain ending with '$expanded_action'"; - return; + $c->log->debug("captures [@{$captures}] do not match the type constraints in actionchain ending with '$expanded_action'") + if $c->debug; + return undef; } } @@ -1656,8 +1657,9 @@ sub uri_for { # At this point @encoded_args is the remaining Args (all captures removed). if($expanded_action->has_args_constraints) { unless($expanded_action->match_args($c,\@args)) { - carp "args [@args] do not match the type constraints in action '$expanded_action'"; - return; + $c->log->debug("args [@args] do not match the type constraints in action '$expanded_action'") + if $c->debug; + return undef; } } }