upped versions prepped release
[catagits/Catalyst-Runtime.git] / lib / Catalyst / Plugin / Unicode / Encoding.pm
index 6da27ad..a689f2c 100644 (file)
@@ -81,6 +81,7 @@ sub prepare_uploads {
     $c->next::method(@_);
 
     my $enc = $c->encoding;
+    return unless $enc;
 
     for my $key (qw/ parameters query_parameters body_parameters /) {
         for my $value ( values %{ $c->request->{$key} } ) {
@@ -114,6 +115,9 @@ sub prepare_action {
 
     my $ret = $c->next::method(@_);
 
+    my $enc = $c->encoding;
+    return $ret unless $enc;
+
     foreach (@{$c->req->arguments}, @{$c->req->captures}) {
       $_ = $c->_handle_param_unicode_decoding($_);
     }
@@ -175,8 +179,7 @@ sub _handle_param_unicode_decoding {
 
 sub handle_unicode_encoding_exception {
     my ( $self, $exception_ctx ) = @_;
-    $self->log->warn($exception_ctx->{error_msg});
-    return $exception_ctx->{'param_value'};
+    die $exception_ctx->{error_msg};
 }
 
 1;