[Catalyst-commits] r14092 - in
Catalyst-Plugin-Unicode-Encoding/branches/decoding_callback:
lib/Catalyst/Plugin/Unicode t/lib
wreis at dev.catalyst.perl.org
wreis at dev.catalyst.perl.org
Tue Sep 6 11:57:51 GMT 2011
Author: wreis
Date: 2011-09-06 11:57:51 +0000 (Tue, 06 Sep 2011)
New Revision: 14092
Modified:
Catalyst-Plugin-Unicode-Encoding/branches/decoding_callback/lib/Catalyst/Plugin/Unicode/Encoding.pm
Catalyst-Plugin-Unicode-Encoding/branches/decoding_callback/t/lib/TestApp.pm
Log:
Rename callback method and rethrow the exception for the default handler
Modified: Catalyst-Plugin-Unicode-Encoding/branches/decoding_callback/lib/Catalyst/Plugin/Unicode/Encoding.pm
===================================================================
--- Catalyst-Plugin-Unicode-Encoding/branches/decoding_callback/lib/Catalyst/Plugin/Unicode/Encoding.pm 2011-09-06 10:59:28 UTC (rev 14091)
+++ Catalyst-Plugin-Unicode-Encoding/branches/decoding_callback/lib/Catalyst/Plugin/Unicode/Encoding.pm 2011-09-06 11:57:51 UTC (rev 14092)
@@ -140,15 +140,11 @@
$value
: $enc->decode( $value, $CHECK );
} catch {
- $self->unicode_encoding_fallback($value, $_);
+ $self->handle_unicode_encoding_exception($value, $_);
};
}
-sub unicode_encoding_fallback {
- my ( $self, $param_value, $error_msg ) = @_;
- $self->error($error_msg);
- return $param_value;
-}
+sub handle_unicode_encoding_exception { die pop }
1;
@@ -204,7 +200,7 @@
Setups C<< $c->encoding >> with encoding specified in C<< $c->config->{encoding} >>.
-=item unicode_encoding_fallback
+=item handle_unicode_encoding_exception
Callback method used for failed decoding process.
Modified: Catalyst-Plugin-Unicode-Encoding/branches/decoding_callback/t/lib/TestApp.pm
===================================================================
--- Catalyst-Plugin-Unicode-Encoding/branches/decoding_callback/t/lib/TestApp.pm 2011-09-06 10:59:28 UTC (rev 14091)
+++ Catalyst-Plugin-Unicode-Encoding/branches/decoding_callback/t/lib/TestApp.pm 2011-09-06 11:57:51 UTC (rev 14092)
@@ -12,7 +12,7 @@
__PACKAGE__->setup;
-sub unicode_encoding_fallback {
+sub handle_unicode_encoding_exception {
my ( $self, $param_value, $error_msg ) = @_;
return $param_value;
}
More information about the Catalyst-commits
mailing list