[Catalyst-commits] r10674 - Catalyst-Runtime/5.80/trunk/lib
rafl at dev.catalyst.perl.org
rafl at dev.catalyst.perl.org
Fri Jun 26 15:27:56 GMT 2009
Author: rafl
Date: 2009-06-26 15:27:55 +0000 (Fri, 26 Jun 2009)
New Revision: 10674
Modified:
Catalyst-Runtime/5.80/trunk/lib/Catalyst.pm
Log:
Throw redispatch exception objects instead of plain strings for detach and go.
Modified: Catalyst-Runtime/5.80/trunk/lib/Catalyst.pm
===================================================================
--- Catalyst-Runtime/5.80/trunk/lib/Catalyst.pm 2009-06-26 15:27:42 UTC (rev 10673)
+++ Catalyst-Runtime/5.80/trunk/lib/Catalyst.pm 2009-06-26 15:27:55 UTC (rev 10674)
@@ -7,6 +7,8 @@
use bytes;
use B::Hooks::EndOfScope ();
use Catalyst::Exception;
+use Catalyst::Exception::Detach;
+use Catalyst::Exception::Go;
use Catalyst::Log;
use Catalyst::Request;
use Catalyst::Request::Upload;
@@ -58,8 +60,8 @@
our $COUNT = 1;
our $START = time;
our $RECURSION = 1000;
-our $DETACH = "catalyst_detach\n";
-our $GO = "catalyst_go\n";
+our $DETACH = Catalyst::Exception::Detach->new;
+our $GO = Catalyst::Exception::Go->new;
#I imagine that very few of these really need to be class variables. if any.
#maybe we should just make them attributes with a default?
@@ -1509,10 +1511,10 @@
my $last = pop( @{ $c->stack } );
if ( my $error = $@ ) {
- if ( !ref($error) and $error eq $DETACH ) {
+ if ( ref($error) and $error eq $DETACH ) {
die $DETACH if($c->depth > 1);
}
- elsif ( !ref($error) and $error eq $GO ) {
+ elsif ( ref($error) and $error eq $GO ) {
die $GO if($c->depth > 0);
}
else {
More information about the Catalyst-commits
mailing list