[Jifty-commit] r3398 - jifty/branches/fragcont/lib/Jifty

jifty-commit at lists.jifty.org jifty-commit at lists.jifty.org
Fri Jun 8 03:02:47 EDT 2007


Author: clkao
Date: Fri Jun  8 03:02:46 2007
New Revision: 3398

Modified:
   jifty/branches/fragcont/lib/Jifty/Dispatcher.pm

Log:
Prevent infinite loop when unable to render mason_internal_error.


Modified: jifty/branches/fragcont/lib/Jifty/Dispatcher.pm
==============================================================================
--- jifty/branches/fragcont/lib/Jifty/Dispatcher.pm	(original)
+++ jifty/branches/fragcont/lib/Jifty/Dispatcher.pm	Fri Jun  8 03:02:46 2007
@@ -1149,6 +1149,7 @@
     my $self     = shift;
     my $template = shift;
     my $showed   = 0;
+#    local $@;
     eval {
         foreach my $handler ( Jifty->handler->view_handlers ) {
             if ( Jifty->handler->view($handler)->template_exists($template) ) {
@@ -1167,7 +1168,11 @@
 
     # Handle parse errors
     if ( $err and not eval { $err->isa('HTML::Mason::Exception::Abort') } ) {
-
+        if ($template eq '/__jifty/error/mason_internal_error') {
+            $self->log->debug("can't render internal_error: $err");
+            $self->_abort;
+            return;
+        }
         # Save the request away, and redirect to an error page
         Jifty->web->response->error($err);
         my $c = Jifty::Continuation->new(
@@ -1176,8 +1181,6 @@
             parent   => Jifty->web->request->continuation,
         );
 
-        warn "$err";
-
         # Redirect with a continuation
         Jifty->web->_redirect( "/__jifty/error/mason_internal_error?J:C=" . $c->id );
     } elsif ($err) {


More information about the Jifty-commit mailing list