X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FCatalyst.pm;h=154b3d4ed44f6e7dcba8c3b6bda33393f6fc7fa3;hb=f6ddb2f242a1635b4a5ba848f61d87c1093422dc;hp=f3e55251c0bfceb65769d8330f1541f690c4000a;hpb=ef52d28f14574311a08012a742a704c36fd1cc28;p=catagits%2FCatalyst-Runtime.git
diff --git a/lib/Catalyst.pm b/lib/Catalyst.pm
index f3e5525..154b3d4 100644
--- a/lib/Catalyst.pm
+++ b/lib/Catalyst.pm
@@ -3581,8 +3581,12 @@ Receives a hashref of debug information. Example of call:
encoding_step => 'params',
});
-You can override this for custom handling of unicode errors. If you want a
-custom response here, one approach is to throw an HTTP style exception:
+It expects to receive a decoded string.
+
+You can override this for custom handling of unicode errors. By
+default we just die. If you want a custom response here, one approach
+is to throw an HTTP style exception, instead of returning a decoded
+string or throwing a generic exception.
sub handle_unicode_encoding_exception {
my ($c, $params) = @_;
@@ -3595,13 +3599,15 @@ in your application:
sub handle_unicode_encoding_exception {
my ($c, $params) = @_;
$c->stash(BAD_UNICODE_DATA=>$params);
+ # return a dummy string.
return 1;
}
-NOTE: Please keep in mind that once an error like this occurs, the request
-setup is aborted, which means the state of C<$c> and related context parts like
-the request and response may not be setup up correctly (since we never finished the
-setup.
+NOTE: Please keep in mind that once an error like this occurs,
+the request setup is still ongoing, which means the state of C<$c> and
+related context parts like the request and response may not be setup
+up correctly (since we haven't finished the setup yet). If you throw
+an exception the setup is aborted.
=cut