From: Marco Pessotto Date: Wed, 20 Jul 2016 07:51:11 +0000 (+0200) Subject: Be clearer about the return value of handle_unicode_exception X-Git-Tag: 5.90111^2 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=commitdiff_plain;h=7374d0c8847553be888890636435e142608fff48;hp=f6ddb2f242a1635b4a5ba848f61d87c1093422dc Be clearer about the return value of handle_unicode_exception --- diff --git a/lib/Catalyst.pm b/lib/Catalyst.pm index 154b3d4..880bf40 100644 --- a/lib/Catalyst.pm +++ b/lib/Catalyst.pm @@ -3571,17 +3571,18 @@ sub setup_encoding { =head2 handle_unicode_encoding_exception -Hook to let you customize how encoding errors are handled. By default +Hook to let you customize how encoding errors are handled. By default we just throw an exception and the default error page will pick it up. -Receives a hashref of debug information. Example of call: +Receives a hashref of debug information. Example of call (from the +Catalyst internals): - $c->handle_unicode_encoding_exception({ + my $decoded_after_fail = $c->handle_unicode_encoding_exception({ param_value => $value, error_msg => $_, encoding_step => 'params', - }); + }); -It expects to receive a decoded string. +The calling code expects to receive a decoded string or an exception. You can override this for custom handling of unicode errors. By default we just die. If you want a custom response here, one approach