Explain the logic here, as it's crazy. But I think this works.
Tomas Doran [Tue, 25 Oct 2011 21:12:35 +0000 (14:12 -0700)]
And I hope this explains, rather than confuses

lib/Catalyst.pm

index 28ec0eb..7cd76d5 100644 (file)
@@ -2023,6 +2023,13 @@ sub prepare {
         $c->response->status(400);
         $c->response->content_type('text/plain');
         $c->response->body('Bad Request');
+        # Note we call finalize and then die here, which escapes
+        # finalize being called in the enclosing block..
+        # It in fact couldn't be called, as we don't return $c..
+        # This is a mess - but I'm unsure you can fix this without
+        # breaking compat for people doing crazy things (we should set
+        # the 400 and just return the ctx here IMO, letting finalize get called
+        # above...
         $c->finalize;
         die $_;
     };