[jifty-devel] Broken 'dispatch' (re: [Jifty-commit] r570)

Jesse Vincent jesse at bestpractical.com
Wed Feb 15 00:31:00 EST 2006


can you create a failing test? If so, I'll fix asap
-----------------------
Sent with ChatterEmail
True push email for the Treo Smartphone
http://get.chatteremail.com


-----Original Message-----
From: Thomas Sibley <trs at bestpractical.com>
Date: Tuesday, Feb 14, 2006 9:05 pm
Subject: [jifty-devel] Broken 'dispatch' (re: [Jifty-commit] r570)

> Author: jesse
 Date: Sat Feb 11 17:00:27 2006
 New Revision: 570
 
 Log:
  r23601 at truegrounds:  jesse | 2006-02-11 16:59:14 -0500
  * Refactored the dispatcher to use exceptions rather than LABELS: so that Devel::DProf doesn't fall over
  * Added a new "DevelMode" flag, to toggle the peformance-killing development aids.

This seems to have broken the use of 'dispatch' in run blocks within an app's dispatcher.  The result I'm seeing is that two copies of the pages's content are printed to the browser.  This looks like the result of removing the call to 'last_rule' in '_do_dispatch', but I tried adding it back in, and it didn't seem to fix the problem.

Tom

> Modified: jifty/trunk/lib/Jifty/Dispatcher.pm
 ==============================================================================
 --- jifty/trunk/lib/Jifty/Dispatcher.pm	(original)
 +++ jifty/trunk/lib/Jifty/Dispatcher.pm	Sat Feb 11 17:00:27 2006
 @@ -473,7 +473,7 @@
  no warnings 'exiting';
  
  sub next_rule { next RULE }
 -sub last_rule { last HANDLER }
 +sub last_rule { die "LAST RULE"; }
  sub next_show { last HANDLE_WEB }
  
  =head2 _do_under
 @@ -643,8 +643,9 @@
      my $err = $@;
      # Handle parse errors
      if ( $err and not UNIVERSAL::isa $err, 'HTML::Mason::Exception::Abort' ) {
 +        # XXX TODO: get this into the browser somehow
          warn "Mason error: $err";
 -        Jifty->web->redirect("/__jifty/error/mason_parse_error");
 +        Jifty->web->redirect("/__jifty/error/mason_internal_error");
      } elsif ($err) {
          die $err;
      }
 @@ -702,10 +703,9 @@
              $self->_handle_rules( [ $self->rules('RUN'), 'show' ] );
              $self->_handle_rules( [ $self->rules('CLEANUP') ] );
          }
 -        last_rule;
      };
      if ( my $err = $@ ) {
 -        warn ref($err) .$err;
 +        warn ref($err) . " " ."'$err'" if ( $err !~ /^LAST RULE/);
      }
  }

_______________________________________________
jifty-devel mailing list
jifty-devel at lists.jifty.org
http://lists.jifty.org/cgi-bin/mailman/listinfo/jifty-devel





More information about the jifty-devel mailing list