Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

propagate unhandled exceptions. Fixes gh-166

  • Loading branch information...
commit 4d9038a1ec1e1210563fb3996f8846a4cc868cdb 1 parent a7f792f
@miyagawa miyagawa authored
View
2  lib/Plack/Middleware/Recursive.pm
@@ -17,6 +17,8 @@ sub call {
} catch {
if (blessed $_ && $_->isa('Plack::Recursive::ForwardRequest')) {
return $self->recurse_callback($env)->($_->path);
+ } else {
+ die $_; # rethrow
}
};
View
6 t/Plack-Middleware/recursive/throw.t
@@ -13,6 +13,8 @@ my $app = sub {
return [ 200, [ 'Content-Type', 'text/plain' ], [ "Hello $env->{QUERY_STRING}" ] ];
} elsif ($env->{PATH_INFO} eq '/forwarded') {
Plack::Recursive::ForwardRequest->throw("/forwarded2?q=bar");
+ } elsif ($env->{PATH_INFO} eq '/die') {
+ die "Foo";
}
Plack::Recursive::ForwardRequest->throw("/forwarded?q=bar");
@@ -26,6 +28,10 @@ test_psgi $app, sub {
my $res = $cb->(GET "/");
is $res->code, 200;
is $res->content, "Hello q=bar";
+
+ $res = $cb->(GET "/die");
+ is $res->code, 500;
+ like $res->content, qr/Foo at t/;
};
done_testing;
Please sign in to comment.
Something went wrong with that request. Please try again.